![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
CF专题
文章平均质量分 84
ShadowGhostH
这个作者很懒,什么都没留下…
展开
-
Codeforces Beta Round #1 (水题 + 进制模拟 + 计算几何)
之后想从CF上扒点contest下来做,之前有从后往前补题,所以做contest时想从前往后开。之后的要求是每套题所有题必须补完(flag就立在这里了 hhh)A. Theatre SquareTheatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On th...原创 2018-03-07 15:30:04 · 269 阅读 · 0 评论 -
CodeForces - 543B Destroying Roads (Dijkstra + 堆优化 + 枚举重复部分)
题目题意有 nnn 个城市,mmm 条道路,问可删去多少条道路,使得删去后的图上,从 s1s1s_1 到 t1t1t_1 时间花费小于等于 l1l1l_1,从 s2s2s_2 到 t2t2t_2 时间花费小于等于 l2l2l_2。其中通过任意一条连接两个城市的道路的时间花费都为1思路要想删去的边尽可能多,其实也就是使得满足条件:“从 s1s1s_1 到 t1t1t_1 时间花费小于...原创 2018-09-06 17:12:52 · 207 阅读 · 0 评论 -
CodeForces - 543A Writing Code(背包问题 + dp + 滚动数组)
题目题意有 nnn 个程序猿要写 mmm 行代码,第 iii 个程序猿每行会出现 viviv_i 个 bugbugbug ,问最后总 bugbugbug 数不超过 bbb 的码代码方案数有多少种,答案对 modmodmod 取模 其中,方案定义为,每个程序猿码代码的行数,如果两种方案中,存在一人所码代码行数两次不同,则认为是两种方案。思路如果我们独立的看待每行代码,定义 dp[k...原创 2018-09-06 16:28:16 · 204 阅读 · 0 评论 -
Codeforces Round #374 (Div. 2)(A-D)(水模拟 + 水模拟 + dfs & dp + 优先队列模拟)
A题意:记录被W分离的连续B的数目思路:水题,读入模拟#include<bits/stdc++.h>using namespace std;const int maxn = 1e5+7;char s[maxn];int ans[maxn];int main(){ int n; cin>>n>>s; int cnt = 0...原创 2018-05-07 17:21:39 · 181 阅读 · 0 评论 -
Codeforces Round #386 (Div. 2)(A-E)(水题 + deque模拟 + 思维 + 构造&贪心 + set模拟)
A题意:制作物品的三种材料用比为1:2:4,给出三种物品的用量,问最多能制作出多少质量的物品。思路:判断每种材料最多可以制作出多少个成品,取最小值即可。#include<bits/stdc++.h>using namespace std;const int maxn = 1e5+5;int main(){ int a, b, c; cin>>a&...原创 2018-05-10 17:27:50 · 178 阅读 · 0 评论 -
Codeforces Round #433 (Div. 2)( 模拟 + 思维 + 贪心 + dp )
A题意:给出一个真分数的分子分母的和n,求满足条件的最大的真分数。真分数为:分子小于分母且分子分母互质。gcd判断。#include<bits/stdc++.h>using namespace std;int gcd(int a, int b){ if(b==0) return a; else return gcd(b, a%b);}int main()...原创 2018-05-03 12:11:03 · 175 阅读 · 0 评论 -
Codeforces Round #407 (Div. 2) (A-E) ( 水模拟 + 复杂模拟/multiset优化 + dp + 欧拉路 + 平均数处理bfs)
昨天训练的题目,今天终于把题补完了。补完之后又忍不住骂了自己几句智障,感觉很不是状态。然后立一个flag吧,之后所有的cf div2的题全部补完,不会的看题解补,为区域赛准备。今年作为coder之后压力还是比较大的,不过也是一个比较好的提高的机会吧,累并快乐着。A. Anastasia and pebblesAnastasia loves going for a walk in Central U...原创 2018-04-19 20:58:27 · 236 阅读 · 0 评论 -
Educational Codeforces Round 21(A-D)(水题 + 尺取 + 构造 + multiset优化)
这是昨天的训练赛,在场上A出四题,场下看能不能再补出一题。A. Lucky YearApart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lucky if it has no more than 1 no...原创 2018-03-29 14:47:47 · 532 阅读 · 0 评论 -
Educational Codeforces Round 39 (Rated for Div. 2)(A-D)(水题 + 模拟 + 贪心模拟 + DP)
昨天用cf的virtual contest开了一场,做的不是特别理想。半个小时A了三题后就一直划水,今天补了D题。A. PartitionYou are given a sequence a consisting of n integers. You may partition this sequence into two sequences b and c in such a way that ...原创 2018-03-13 14:06:05 · 402 阅读 · 0 评论 -
Codeforces Round #469 (Div. 2)(A-D)(水题 + 模拟 + 模拟 + 规律公式)
昨天下午4点场的CF,正好上完课喝着茶叶顶着打完了一场。巨开心的就是这场CF结束后蓝名了,美滋滋,继续努力~A. Left-handers, Right-handers and AmbidextersYou are at a water bowling training. There are l people who play with their left hand, r people, who...原创 2018-03-10 14:32:51 · 346 阅读 · 0 评论 -
Codeforces Round #468 (Div. 2,)(模拟 + 二进制位运算 + 贪心模拟 + dfs树)
数学建模这门课没选上,sad。所以在胖胖他们上课的时候有空开了一场,在开之前大概看了一眼过的人数,当时就想好了这场要过四个题。flag果然是立早了呢。A. Friends MeetingTwo friends are on the coordinate axis Ox in points with integer coordinates. One of them is in the point x...原创 2018-03-16 15:37:29 · 336 阅读 · 0 评论 -
Codeforces Round #427 (Div. 2) (A-E)(水题 + 贪心 + dp容斥前缀和 + manacher回文串 + 位运算构造)
这场是昨天的校赛,场上只出了两个题,下来后当天补出了C题,今天补完了D E。然后留博客总结。A. Key racesTwo boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of scharacters...原创 2018-03-15 21:11:29 · 369 阅读 · 0 评论 -
Codeforces Round #357 (Div. 2) (A-D)(水题 + 暴力 + 堆模拟 + DFS)
这是寒假周训的题,因为看到CF上没有做完所以去补发现周训已经做出来四题了,于是就顺手写一下题解吧。BTW,周训的时候一天一场CF确实提升很大。A. A Good ContestCodeforces user' handle color depends on his rating — it is red if his rating is greater or equal to 2400; it is...原创 2018-03-09 11:17:10 · 299 阅读 · 0 评论 -
Codeforces Round #193 (A-C)(水题 + DP + 贪心)
这场是周三训练赛的一场CF,一个半小时只做出来了AB,后来补到了C。这大概是一场阅读理解场吧,全场读不懂题目。这英语水平怎么过六级啊喂A. Down the Hatch!Everybody knows that the Berland citizens are keen on health, especially students. Berland students are so tough th...原创 2018-03-08 17:33:03 · 434 阅读 · 0 评论 -
Codeforces Round #473 (Div. 2) (A-E) (水题 + 并查集 + 构造 + 分解因数 + 贪心)
A题意给出一个数 nnn,两人每次可以选择一个数 aaa,使得 n=n−an = n - an=n−a。其中a≥1a \geq 1a≥1 且第一个人选的a应为偶数,第二个人选的应为奇数,谁不能选的时候为负。谁不能操作为负,问谁能赢。思路判断 nnn 的奇偶性即可,先手偶数不改变奇偶性,后手奇数改变奇偶性,当 n==0n==0n==0 时游戏结束,也就是说仅判断 nnn 的奇偶性即可。代码...原创 2018-11-05 17:20:16 · 223 阅读 · 0 评论