CF 329A(Purification-贪心-非DLX)】的更多相关文章

A. Purification time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a…
A. Purification Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/329/problem/A Description You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square r…
题目:http://codeforces.com/contest/949/problem/D 有二分答案的思路. 如果二分了一个答案,首先可知越靠中间的应该大约越容易满足,因为方便把别的房间的人聚集过来:所以如果二分了答案为 f ,可以认为合法的房间是除了前 f 个和后 f 个的剩下的房间. 但边缘房间自己能满足时也不用专门往中间跑,但一旦要跑,方向一定是向中间的:所以可以用指针判断: 可以认为 f 是合法房间的一个界限:指针走的时候累计一下已经有多少人,当又满足一个房间时,如果指针在界限 f…
Covered Path time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The on-board computer on Polycarp's car measured that the car speed at the beginning of some section of the path equals v1 meter…
http://codeforces.com/contest/389/problem/E 这道题目刚开始想的特别麻烦...但是没想到竟然是贪心 我们只需要知道偶数的时候可以对称取的,然后奇数的时候没次取得就留下中间就可以了.最后对中间进行处理即可.…
http://codeforces.com/contest/462 A:Appleman and Easy Task 要求是否全部的字符都挨着偶数个'o' #include <cstdio> using namespace std; ][]; int n; ][]; ]={,,-,}; ]={,-,,}; int main(){ scanf("%d",&n); gets(maz[]); ;i<n;i++){ gets(maz[i]); } ;i<n;i+…
https://codeforces.com/contest/1257/problem/E 题意:有三个集合集合里面的数字可以随意变换位置,不同集合的数字,如从第一个A集合取一个数字到B集合那操作数+1,求最少操作次数使得一二三集合连起来是升序 我们先把每个集合排个序,然后拼起来,求一遍lis(最长升序序列:https://blog.csdn.net/Joined/article/details/78058362),然后n-len即为答案 网上那些什么dp什么的..嘻嘻太高深 #include<…
http://codeforces.com/contest/330/problem/C 这道题分三种情况.有一行全是E,有一列全是E,还有一种为无解的情况. #include <cstdio> #include <cstring> #include <algorithm> #define maxn 200 using namespace std; char g[maxn][maxn]; int r[maxn],c[maxn]; int main() { int n; s…
One day Dima and Alex had an argument about the price and quality of laptops. Dima thinks that the more expensive a laptop is, the better it is. Alex disagrees. Alex thinks that there are two laptops, such that the price of the first laptop is less (…
Codeforces Round #401 (Div. 2) 很happy,现场榜很happy,完全将昨晚的不悦忘了.终判我校一片惨白,小董同学怒怼D\E,离AK就差一个C了,于是我AC了C题还剩35分钟立刻开D题,不料英文苦涩难懂,懂了题意之后发现也是个水题,从后往前遍历一遍即可.然而代码速度和思维都不算很好,还有半分钟在徘徊要不要测一下样例,但又怕OJ卡了,直接交第一组就跪了,然后发现个小问题改改又直接交最后5秒然而以第一组WA结束本场CF. A  Shell Game 题意:有三个位置分别…