- 博客(264)
- 收藏
- 关注
原创 UVa 10881Piotr's Ants【思维】
题目链接对于每个蚂蚁来说,他相对于其他蚂蚁的位置是固定的,赶超前面或者被后面的赶超都是要回头的,所以,假设木棒无限长,位于第一位的永远在第一位,第二位的永远在第二位。同时每两个碰头的蚂蚁其实就是类似于交换了身份继续前进。所以,先不管他们的碰头,就让每个沿着路线继续走下去。由前面的可以知道,每个蚂蚁的最终状态的位置排列的顺序就是一开始蚂蚁的编号。#include #include #in
2017-04-29 14:38:54
427
原创 light oj 1245 1245 - Harmonic Number (II)【数论】
1245 - Harmonic Number (II) PDF (English)StatisticsForumTime Limit: 3 second(s)Memory Limit: 32 MBI was trying to solve problem '1234 - Harmonic Numbe
2017-04-26 21:47:13
394
原创 lightoj 1259 - Goldbach`s Conjecture【素数打表】
1259 - Goldbach`s Conjecture PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBGoldbach's conjecture is one of the oldest unsolved
2017-04-26 20:36:31
499
原创 lightOj 1341Aladdin and the Flying Carpet 算数基本定理
1341 - Aladdin and the Flying Carpet PDF (English)StatisticsForumTime Limit: 3 second(s)Memory Limit: 32 MBIt's said that Aladdin had to solve seven m
2017-04-26 19:58:27
352
原创 HAUT校赛 魔法宝石 暴力
问题 C: 魔法宝石时间限制: 2 秒 内存限制: 64 MB提交: 505 解决: 149提交 状态 题目描述小s想要创造n种魔法宝石。小s可以用ai的魔力值创造一棵第i种魔法宝石,或是使用两个宝石合成另一种宝石(不消耗魔力值)。请你帮小s算出合成某种宝石的所需的最小花费。输入第一行为数据组数T(1≤T≤3)。对于每组数据,首先一行为n,m(1≤n
2017-04-26 19:51:45
369
原创 天梯赛5-12 愿天下有情人都是失散多年的兄妹 【dfs】
5-12 愿天下有情人都是失散多年的兄妹 (25分)呵呵。大家都知道五服以内不得通婚,即两个人最近的共同祖先如果在五代以内(即本人、父母、祖父母、曾祖父母、高祖父母)则不可通婚。本题就请你帮助一对有情人判断一下,他们究竟是否可以成婚?输入格式:输入第一行给出一个正整数N(2 \le≤ N \le 10^4≤104),随后N行,每行按以下格式给出一个人的
2017-03-23 22:00:30
1588
原创 poj2718 Smallest Difference【贪心】
Smallest DifferenceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10453 Accepted: 2855DescriptionGiven a number of distinct decimal digits, you can for
2017-03-15 19:53:55
353
原创 HDU problem 5635 LCP Array【思维】
LCP ArrayTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1532 Accepted Submission(s): 468Problem DescriptionPeter has a str
2017-03-08 18:03:52
279
原创 codeforces 782C Andryusha and Colored Balloons【构造】
C. Andryusha and Colored Balloonstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndryusha goes through a
2017-03-07 18:13:21
546
原创 HDU 4278 Faulty Odometer【水题】
Faulty OdometerTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2017 Accepted Submission(s): 1398Problem Description You are
2017-03-07 18:05:08
290
原创 codeforces B. The Meeting Place Cannot Be Changed【二分】
B. The Meeting Place Cannot Be Changedtime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe main road in Byt
2017-03-06 20:27:39
506
原创 POJ 3264 Balanced Lineup 【线段树】
Balanced Lineup Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 50004 Accepted: 23434 Case Time Limit: 2000MS DescriptionFor the daily milking, Farmer John’s N cows (1 ≤ N ≤
2017-01-14 18:48:21
289
原创 HDU 1850 - Being a Good Boy in Spring Festival【Nim博弈】
Being a Good Boy in Spring FestivalTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7062 Accepted Submission(s): 4276Problem Descr
2016-12-20 19:01:33
315
原创 CodeForces-714C - Sonya and Queries【状压 】
C - Sonya and Queries CodeForces - 714C 不用字典树进行维护,直接状压用数组保存就可以了。#include #include #include #include #include #include #include #include #include #include #include #include
2016-12-06 21:01:17
398
原创 HDU Problem 1247 Hat's Words 【字典树】
Hat’s WordsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13908 Accepted Submission(s): 4987Problem DescriptionA hat’s word
2016-11-19 14:50:40
286
原创 HDU Problem 1754 I Hate It 【线段树】
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 67459 Accepted Submission(s): 26244Problem Description很多学校流行一种比较的习惯。
2016-11-18 19:16:54
218
原创 POJ - 2182 Lost Cows【线段树】
题目链接 首先,题意比较清楚,给你n-1个数,表示从2到n,其中ai表示编号为i头牛所处位置的前面有几个的序号比他小。通过这些数据,让你输出这些牛的排列顺序。思路:对于最后的一头牛,他肯定是(an+1),通过这个规律,可以到这推出所有牛的顺序,你可以标记,然后暴力跑一边,但是效率不高。这里,可以用线段树进行维护。#include #include #include #in
2016-11-16 12:54:56
233
原创 HDU - problem 1387 Team Queue【队列】
Team QueueTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1999 Accepted Submission(s): 688Problem DescriptionQueues and Prior
2016-11-14 22:09:53
300
原创 hdu - Problem 1175 连连看 【bfs】
http://acm.hdu.edu.cn/showproblem.php?pid=1175Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 32089 Accepted Submission(s): 7900
2016-11-12 20:19:41
304
原创 codeforces 233c Cycles【贪心】
Cyclestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputJohn Doe started thinking about graphs. After some th
2016-11-12 18:11:50
356
原创 HDU Problem - 1058 Humble Numbers 【dp】
Humble NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24415 Accepted Submission(s): 10702Problem DescriptionA number
2016-11-12 15:15:17
199
原创 wmjxoj - 1050: QAQ的公式求解(二)【快速幂 + 矩阵】
题目传送门矩阵加快速幂运算才发现这么好用。根据递推公式f(i+1) = fi + (i+1)*(i+1) + (i+1)构造矩阵| f(i) + (i+1)*(i+1) + (i+1) | | 1 1 1 0 | | f(1) || (i + 2)*(i + 2)
2016-11-02 19:40:47
284
原创 HDU - problem Tr A 【快速幂 + 矩阵】
Tr ATime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4488 Accepted Submission(s): 3377Problem DescriptionA为一个方阵,则Tr A表示A的迹(就是主
2016-11-01 19:45:17
242
原创 poj - problem 3070 Fibonacci 【矩阵 +快速幂】
FibonacciTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 13732 Accepted: 9728DescriptionIn the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn
2016-11-01 19:27:43
541
原创 HDU - problem 1757 A Simple Math Problem【矩阵 + 快速幂】
A Simple Math ProblemTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4283 Accepted Submission(s): 2573Problem DescriptionLele
2016-11-01 16:09:07
247
原创 codeforces - 732D Exams 【二分 + 贪心】
Examstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasiliy has an exam period which will continue for n d
2016-10-31 20:23:45
298
原创 poj - 2406 Power Strings 【KMP】
Power StringsTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 45224 Accepted: 18873DescriptionGiven two strings a and b we define a*b to be their co
2016-10-31 13:36:43
337
原创 codeforces - 444c DZY Loves Physics【水】
DZY Loves PhysicsDZY loves Physics, and he enjoys calculating density.Almost everything has density, even a graph. We define the density of a non-directed graph (nodes and edges of the
2016-10-30 16:46:19
463
原创 hdu - 4506 小明系列故事——师兄帮帮忙 【快速幂】
小明系列故事——师兄帮帮忙Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 5596 Accepted Submission(s): 1528Problem Description 小明自从告别了ACM
2016-10-30 14:59:23
297
原创 hdu - 5945 Fxx and game 【dp + 单调队列】
Fxx and gameTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 413 Accepted Submission(s): 100Problem DescriptionYoung theoreti
2016-10-30 12:39:17
411
原创 poj 2823 - Sliding Window【单调队列模板】
Sliding WindowTime Limit: 12000MS Memory Limit: 65536KTotal Submissions: 55797 Accepted: 16048Case Time Limit: 5000MSDescriptionAn array of size n ≤ 106
2016-10-30 09:54:38
261
原创 hdu - problem 1671 Phone List【字典树】
Phone ListTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18382 Accepted Submission(s): 6189Problem DescriptionGiven a list o
2016-10-27 21:33:38
262
原创 hdu - problem 1251 统计难题【字典树】
统计难题Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 35486 Accepted Submission(s): 13269Problem DescriptionIgnatius最近遇到一个难题,老
2016-10-27 20:42:18
245
原创 hdu - 4324 Triangle LOVE【dfs】
Triangle LOVETime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 4610 Accepted Submission(s): 1809Problem DescriptionRecently, sc
2016-10-26 20:03:51
354
原创 POJ - 3041 Asteroids 【二分图匹配】
AsteroidsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20881 DescriptionBessie wants to navigate her spaceship through a dangerous asteroid field
2016-10-26 18:55:17
288
原创 UVA - 1388 Graveyard 【数学】
题目链接题意:给一个周长为10000的圆,一开始有n个距离相等的点, 现在要添加m个点使其仍旧保持距离相等的状态,问最小的移动距离。思路:遍历原来的每一个点,找出离他最近的新的位置。#include #include #include #include #include #include #include #include #include #include
2016-10-25 18:55:37
216
原创 poj - 1579 Function Run Fun 【dp】
Function Run FunTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 18338 Accepted: 9372DescriptionWe all love recursion! Don't we? Consider a three-par
2016-10-22 15:40:18
296
原创 codeforces - 337c Quiz【贪心】
C. Quiztime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputManao is taking part in a quiz. The quiz consists of
2016-10-20 22:01:14
378
原创 codeforces -297c Splitting the Uniqueness【构造】
Splitting the Uniquenesstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolar bears like unique arrays — th
2016-10-19 21:54:37
273
原创 codeforces - 257c View Angle 【数学】
C. View Angletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFlatland has recently introduced a new type o
2016-10-17 21:00:02
346
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人