随笔分类 - codeforce
摘要:题意是有n个箱子, 每个箱子上最多承放Xi个箱子。 问最少搭成多少堆。这道题显然是贪心。。但是比赛的时候脑残了。。做了一个多小时的二分, 都不知道为什么100 的数据量自己要去做二分。。。早上起来发现二分错在判断条件少加了个1.。orz。。。贪心策略就是从小到大排序,然后把每个箱子放在他能放的最大堆下。。。题目:C. Fox and Box Accumulationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel has n.
阅读全文
摘要:题目给出一个图, 问图中所有的“#”能否恰好独立的组成十字架(一个#只能在一个十字架中)一开始用dfs写的好混乱。。 后面发现从左上到右下,如果一个#满足正好在中间且四周可以消去,那就一定要消去,否则就NO。这样枚举一遍就好了。题目:B. Fox and Crosstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel has a board with n rows and n columns. So, the board cons
阅读全文
摘要:题意大致就是在给出的数列中不断取出 i,j 两个数,ai>aj , 然后把 ai-aj重新放入,直到不能做为止我用了个优先队列模拟。 因为可能同时有几个最大值。。所以不能单纯的比较最大值和后面一个最大值相等就停止题目:A. Fox and Number Gametime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel is playing a game with numbers now.Ciel has n positive i
阅读全文
浙公网安备 33010602011771号