Codeforces Round #254 (Div. 2)D(预计)】的更多相关文章

layout: post title: Codeforces Round 254 (Div. 2) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces - 模拟栈 - 贪心 传送门 A.DZY Loves Chessboard (签到) 题意 给你一个N×M的地图 再空地上填上白棋或者黑棋要求同色棋子不能相邻 思路 直接搜索一下 #include<bits/stdc++.h> using…
D. DZY Loves FFT time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY loves Fast Fourier Transformation, and he enjoys using it. Fast Fourier Transformation is an algorithm used to calculate…
题目链接: http://codeforces.com/problemset/problem/444/C J. DZY Loves Colors time limit per test:2 secondsmemory limit per test:256 megabytes 问题描述 DZY loves colors, and he enjoys painting. On a colorful day, DZY gets a colorful ribbon, which consists of…
D - DZY Loves Strings 思路:感觉这种把询问按大小分成两类解决的问题都很不好想.. https://codeforces.com/blog/entry/12959 题解说得很清楚啦. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL> #define PLI pai…
D. DZY Loves Strings 题目连接: http://codeforces.com/contest/444/problem/D Description DZY loves strings, and he enjoys collecting them. In China, many people like to use strings containing their names' initials, for example: xyz, jcvb, dzy, dyh. Once DZ…
C. DZY Loves Colors 题目连接: http://codeforces.com/contest/444/problem/C Description DZY loves colors, and he enjoys painting. On a colorful day, DZY gets a colorful ribbon, which consists of n units (they are numbered from 1 to n from left to right). T…
A. DZY Loves Physics 题目连接: http://codeforces.com/contest/444/problem/A Description DZY loves Physics, and he enjoys calculating density. Almost everything has density, even a graph. We define the density of a non-directed graph (nodes and edges of th…
题目链接: http://codeforces.com/problemset/problem/445/A 题解: 这道题是在现场赛的最后一分钟通过的,相当惊险,而且做的过程也很曲折. 先是用递推,结果发现递推下去可能会出现非法的情况(一开始还不知道,坚定不移地认为这种方法是对的.Now,what can I say?) 然后用回溯,就是类似在递推的方式下,如果遇到非法就退回上一步,有了改错的机会.结果,超时.也是,这种方法太暴力了. 最后想到:一个格子的与之相邻的格子(如果能涂色),其颜色必定不…
http://codeforces.com/contest/444/problem/C 题意:给出一个数组,初始时每个值从1--n分别是1--n.  然后两种操作. 1:操作 a.b内的数字是a,b内的数字变成v,然后得到的变化值记为dx. 2:询问 a,b内的变化值得大小. sl:做法是懂了,但是这么做为什么不会超时? 稍微意淫了下大概是正解. 直接线段树 lazy维护两个标记 1是当前的颜色,二是变化值. 线段树维护最后的变化值. 我的代码: http://codeforces.com/co…
链接:http://codeforces.com/contest/445/problem/B 描述:n种药品,m个反应关系,按照一定顺序放进试管中.如果当前放入的药品与试管中的药品要反应,危险系数变为之前的2倍:否则危险系数不改变.起始危险系数为1.求可能的最大的危险系数. 思路:遍历图 在图上画一画,就会发现,只要一块连通的图中的一个点放入后,之后每添加这块图中的一个点就会导致危险系数乘2.那么我们只需要找到一共有多少个连通图tmp,然后用总数减去得到ans.答案就是1LL<<ans.注意l…