
题库-CF CodeForces
文章平均质量分 78
snowy_smile
终于在ICPC World Final里拿到了气球!
再努力一点吧,坚持下去吧,梦想是会实现的! 人生会有低谷,但我更相信,未来也会有更多梦想能够实现~
展开
-
【UKIEPC2015 M】【暴力匹配+SET去重】Milestone Counter 匀速行驶 合法的里程碑起点
#include #include#include#include#include#include#include#includeusing namespace std;typedef long long LL;const int N=1e3+10;int n,m;LL t[N],a[N],d[N],b[N];LL gcd(LL x,LL y){ return原创 2015-11-03 17:41:02 · 698 阅读 · 0 评论 -
【UKIEPC2015 H】【凸包思维栈操作】Sunlight 每座建筑的日照时间
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-03 21:07:41 · 1179 阅读 · 0 评论 -
【UKIEPC2015 J】【趣味迷宫搜索】Jelly Raid 来回巡逻 不被发觉 循环节预处理
#include #include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c原创 2015-11-03 17:44:14 · 763 阅读 · 0 评论 -
【UKIEPC2015 G】【DP】Drink Responsibly 买酒喝 双关键字DP恰好都用完 注意精度
#include #include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("原创 2015-11-03 17:42:04 · 1385 阅读 · 0 评论 -
【UKIEPC2015 I】【模拟】Nimionese 特殊语言转化 逻辑清晰暴力扫描
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-03 19:31:45 · 745 阅读 · 0 评论 -
【UKIEPC2015 C】【STL set map stringstream】Conversation Log 网络审查 被所有人都说过的话 map套set法+人哈希法
map套set法:#include #include#include#include#include#include#include#includeusing namespace std;const int N=1e4+5;const int L=2e6+10;setname;//记录所有人名map >cnt;//记录说过每句话的所有人名mapfreq;//记录每句话原创 2015-11-03 17:43:18 · 824 阅读 · 0 评论 -
【Codeforces Round 329 (Div 2) B】【映射 排序 贪心】Anton and Lines 查看所有直线pair在[x1,x2]范围内是否有交点
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-06 21:08:27 · 723 阅读 · 0 评论 -
【Codeforces Round 329 (Div 2) A】【暴力枚举】2Char 选单词最多只含2字符
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-06 21:10:08 · 427 阅读 · 0 评论 -
【Codeforces Round 329 (Div 2) D】【LCA+并查集路径压缩】Happy Tree Party 除上两点间路径全部权值
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-06 20:42:20 · 678 阅读 · 0 评论 -
【Codeforces Round 328 (Div 2)B】【找规律】The Monster and the Squirrel 正多边形连边分割块数
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-07 21:32:24 · 714 阅读 · 0 评论 -
【Codeforces Round 328 (Div 2)C】【lcm 讨论题】The Big Race [1,l]长度距离比赛的平局概率
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-07 21:33:38 · 652 阅读 · 0 评论 -
【Codeforces Round 328 (Div 2)A】【水题】PawnChess 棋子向上向下走
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-07 21:31:50 · 419 阅读 · 0 评论 -
【Codeforces Round 328 (Div 2)D】【树的直径 树的重心 贪心 两次dfs都找最小编号最远点】Super M 经过树上所有重要点的最小距离
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-07 21:34:37 · 816 阅读 · 0 评论 -
【2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest F】【贪心+ STL-优先队列】 Gourmet and Banquet 最大活动时间
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;void fre(){freopen("c://test//input.in","r",stdin);freopen("c:原创 2015-11-08 19:10:08 · 789 阅读 · 0 评论 -
【2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest H】【观察找规律 脑洞 构造】Tourist Guide 关键点作端点最多路径
H. Tourist Guidetime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputIt is not that easy to create a tourist guide as one might expect. A good tourist guide should properly distribute flow of tourists a原创 2015-11-08 12:41:32 · 948 阅读 · 0 评论 -
【2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest D】【模拟 讨论】Boulevard 人流行走看是否相交 beautiful code
D. Boulevardtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputWelcoming autumn evening is the best for walking along the boulevard and n people decided to do so.The boulevard can be represented as原创 2015-11-08 17:17:28 · 604 阅读 · 0 评论 -
【2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest G】【数据结构-线段树】Hiring 准备时间完成时间最早完成日期
G. Hiringtime limit per test4 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputThe head of human resources department decided to hire a new employee. He created a test exercise for candidates which should be accomplishe原创 2015-11-08 13:38:37 · 869 阅读 · 0 评论 -
【Codeforces Round 326 (Div 2)C】【贪心】Duff and Weight Lifting 每次取数二的幂数最小取数次数
C. Duff and Weight Liftingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently, Duff has been practicing原创 2015-11-10 10:37:12 · 781 阅读 · 0 评论 -
【Codeforces Round 324 (Div 2)A】【水题】Olesya and Rodion 构造数长度为n且是t的倍数
A. Olesya and Rodiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOlesya loves numbers consisting of n digits, and Rodion only likes numbers that are divisible by t. Find some number that sat原创 2015-11-09 20:24:12 · 408 阅读 · 0 评论 -
【Codeforces Round 326 (Div 2)B】【质因数分解】Duff in Love n的最大因子使其不为平方数倍数
B. Duff in Lovetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuff is in love with lovely numbers! A positi原创 2015-11-10 10:18:52 · 843 阅读 · 0 评论 -
【Codeforces Round 324 (Div 2)B】【容斥】Kolya and Tanya 环上n个3元组至少有一组和不为6
B. Kolya and Tanyatime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputKolya loves putting gnomes at the circle table and giving them coins, and Tanya loves studying triplets of gnomes, sitting in the ve原创 2015-11-09 20:28:26 · 483 阅读 · 0 评论 -
【Codeforces Round 324 (Div 2)C】【构造 讨论】Marina and Vasya 构造c串使得c串与a串b串各有m个字符不同
C. Marina and Vasyatime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMarina loves strings of the same length an原创 2015-11-09 20:54:44 · 462 阅读 · 0 评论 -
【Codeforces Round 326 (Div 2)D】【DP】Duff in Beach 数列重复取数最多k次使得单调不下降
D. Duff in Beachtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhile Duff was resting in the beach, she acc原创 2015-11-10 11:30:41 · 790 阅读 · 0 评论 -
【Codeforces Round 326 (Div 2)E】【树链剖分】Duff in the Army 树上给定路径上编号最小的几个人
E. Duff in the Armytime limit per test4 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputRecently Duff has been a soldier in the a原创 2015-11-10 11:39:35 · 632 阅读 · 0 评论 -
【2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest A】【模拟 STL-map】Email Aliases 不同邮箱的数量
A. Email Aliasestime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputPolycarp has quite recently learned about email aliases. Of course, he used to suspect that the case of the letters doesn't matter in原创 2015-11-08 12:45:04 · 1194 阅读 · 0 评论 -
【2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest I】【水题】Lottery 均分气球最小修改数
I. Lotterytime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputToday Berland holds a lottery with a prize — a huge sum of money! There are k persons, who attend the lottery. Each of them will receive a原创 2015-11-08 13:55:59 · 1245 阅读 · 0 评论 -
【2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest J】【暴力模拟】Cleaner Robot 机器人行走 决策固定
J. Cleaner Robottime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputMasha has recently bought a cleaner robot, it can clean a floor without anybody's assistance.Schematically Masha's room is a rectan原创 2015-11-08 12:43:20 · 947 阅读 · 0 评论 -
【Codeforces Round 324 (Div 2)D】【miller-rabin素数检验 猜想】Dima and Lisa 奇数拆分成三素数
D. Dima and Lisatime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDima loves representing an odd number as the原创 2015-11-09 20:55:53 · 910 阅读 · 0 评论 -
【Codeforces Round 326 (Div 2)A】【贪心】Duff and Meat 屯肉前溯花费最低
A. Duff and Meattime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuff is addicted to meat! Malek wants to keep原创 2015-11-10 10:11:53 · 1063 阅读 · 0 评论 -
【Codeforces Round 324 (Div 2)E】【贪心 构造】Anton and Ira 全排列交换 最小距离成本
E. Anton and Iratime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnton loves transforming one permutation into原创 2015-11-09 20:57:31 · 556 阅读 · 0 评论 -
【Code Forces 320A】【二进制拆分】Raising Bacteria 细胞繁殖 每天倍增
最少加入多少个细胞,可以使得有一天,培养皿中细胞的数量会恰好为x原创 2015-09-17 15:56:58 · 1180 阅读 · 0 评论 -
【Code Forces 320B】【水题】Finding Team Member 最优组队匹配
最优组队匹配原创 2015-09-17 15:54:37 · 1097 阅读 · 0 评论 -
【Code Forces 320E】【三分+前缀和】Weakness and Poorness 最大的区间和的绝对值尽可能小
使得最大的元素的和绝对值尽可能小原创 2015-09-17 15:26:53 · 1268 阅读 · 0 评论 -
【Code Forces 320D】【贪心+暴力】 "Or" Game 数列乘k次x后求最大or值
数列乘k次x后求最大or值原创 2015-09-17 15:34:00 · 1790 阅读 · 0 评论 -
【Codeforces Round 323 (Div 2)A】【水题】Asphalting Roads 行列之进行首次操作
A. Asphalting Roadstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputCity X consists of n vertical and n hori原创 2015-11-13 11:19:52 · 707 阅读 · 0 评论 -
【Codeforces Round 323 (Div 2)C】【观察找规律 STL map】GCD Table 从GCD矩阵中找出所有原始元素
C. GCD Tabletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe GCD table G of size n × n for an array of原创 2015-11-13 11:22:22 · 855 阅读 · 0 评论 -
【Codeforces Round 323 (Div 2)B】【贪心】Robot's Task 最少转弯次数拿走所有物品
B. Robot's Tasktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRobot Doc is located in the hall, with n compu原创 2015-11-13 11:21:18 · 1185 阅读 · 0 评论 -
【Codeforces Round 323 (Div 2)D】【暴力 脑洞 插入贡献思想】Once Again... 循环节重复T次后的LIS
D. Once Again...time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array of positive integers a原创 2015-11-13 11:23:36 · 1187 阅读 · 0 评论 -
【Codeforces Round #327 (Div. 2) B】 Rebranding 字符变换 同类型打标记
B. Rebrandingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe name of one small but proud corporation con原创 2015-10-29 09:13:37 · 684 阅读 · 0 评论 -
【Codeforces Round #327 (Div. 2) D】【贪心+二分】 Chip 'n Dale Rescue Rangers 救援任务 变风向
D. Chip 'n Dale Rescue Rangerstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA team of furry rescue rangers原创 2015-10-29 09:08:19 · 988 阅读 · 0 评论