CF 352 D 罗宾汉发钱 模拟题+贪心】的更多相关文章

D. Robin Hood time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, a…
cf 443 D. Teams Formation(细节模拟题) 题意: 给出一个长为\(n\)的序列,重复\(m\)次形成一个新的序列,动态消除所有k个连续相同的数字,问最后会剩下多少个数(题目保证消除的顺序对答案不会造成影响) \(n <= 10^{5} ,m <= 10^{9} ,k <= 10^{9},a_i <= 10^{5}\) 思路: 直接上题解好了 首先要用栈预处理序列本身,然后考虑处理后的序列 比较头和尾是否能够消除,细节需要处理好. #include<bi…
There are n rectangles in a row. You can either turn each rectangle by 90 degrees or leave it as it is. If you turn a rectangle, its width will be height, and its height will be width. Notice that you can turn any number of rectangles, you also can t…
http://codeforces.com/contest/723/problem/C 题目是给出一个序列 a[i]表示第i个歌曲是第a[i]个人演唱,现在选出前m个人,记b[j]表示第j个人演唱歌曲的数量, 现在你可以改变a[]这个数组,使得前m个人的演唱歌曲的数量的最小值最大. 很明显对于前m个人,每个人唱了多少首是很容易统计出来的,只需要对<=m的人进行统计即可,不用统计>m的,这样的话数组只需开到2000即可. 对于后面的人,可以改变,优先改变前m个人中演唱歌曲最小的那个,这个可以用优…
只是贴代码,这种模拟题一定要好好纪念下 TAT #include <cstdio> #include <cstring> #include <algorithm> using namespace std; ; bool is[MAXN]; int msg[MAXN]; int first_in[MAXN], last_in[MAXN], last_out[MAXN]; bool flag[MAXN]; bool in[MAXN]; ]; int n, m; int st…
题意:射一次激光最多能够攻击到几个敌人(因为激光非常强大,能够在击中敌人后穿过它,而瑶瑶自己的坦克因为有特殊装置,所以不会被激光击中.激光也会直接穿过它) . 表示此处为空地 * 表示此处为障碍(激光不可穿过.激光路径打到障碍时就结束) T代表瑶瑶的坦克位置 E代表敌人 / 代表按 左下-右上 放置的镜子 \ 代表按 左上-右下 放置的镜子 解法:模拟题.因为位置过多. 所以不能用递归模拟.要注意环的推断.还有射击过的敌人要打上标记. wa了n发,最后发现是=写成了==,真的非常不应该. 代码:…
\(NOIP\)模拟题汇总(加厚版) T1 string 描述 有一个仅由 '0' 和 '1' 组成的字符串 \(A\),可以对其执行下列两个操作: 删除 \(A\)中的第一个字符: 若 \(A\)中 '1' 出现的次数为奇数,则在 \(A\) 的末尾插入 '1',否则在 \(A\) 的末尾插入 '0'. 现在给出一个同样仅由 '0' 和 '1' 组成的字符串 \(B\),请你判断 \(A\) 能否在任意多次操作后转化为 \(B\). 输入 输入文件第一行一个正整数 \(T\),表示有 \(T\…
  8.22 NOIP 模拟题 编译命令 g++ -o * *.cpp gcc -o * *.c fpc *.pas 编译器版本 g++/gcc fpc 评测环境 位 Linux, .3GHZ CPU 评测软件 Lemon 评测方式 忽略行末空格和回车 特别注意:c/c++ 选手使用 printf 输出 位整数请使用%lld 注意事项 A 债务 文件名                            输入文件             输出文件            时空限制 debt.pa…
Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 64795   Accepted: 19978 Description During his last sabbatical, professor M. A. Ya made a surprising discovery about the old Maya calendar. From an old knotted message, profes…
Crossword Answers Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 869   Accepted: 405 Description A crossword puzzle consists of a rectangular grid of black and white squares and two lists of definitions (or descriptions). One list of de…