自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

博客已搬迁到http://www.cnblogs.com/cniwoq/

博客已搬迁到http://www.cnblogs.com/cniwoq/

  • 博客(264)
  • 收藏
  • 关注

原创 UVa 10881Piotr's Ants【思维】

题目链接 对于每个蚂蚁来说,他相对于其他蚂蚁的位置是固定的,赶超前面或者被后面的赶超都是要回头的,所以,假设木棒无限长,位于第一位的永远在第一位,第二位的永远在第二位。同时每两个碰头的蚂蚁其实就是类似于交换了身份继续前进。所以,先不管他们的碰头,就让每个沿着路线继续走下去。由前面的可以知道,每个蚂蚁的最终状态的位置排列的顺序就是一开始蚂蚁的编号。 #include #include #in

2017-04-29 14:38:54 266

原创 light oj 1245 1245 - Harmonic Number (II)【数论】

1245 - Harmonic Number (II)     PDF (English) Statistics Forum Time Limit: 3 second(s) Memory Limit: 32 MB I was trying to solve problem '1234 - Harmonic Numbe

2017-04-26 21:47:13 274

原创 lightoj 1259 - Goldbach`s Conjecture【素数打表】

1259 - Goldbach`s Conjecture     PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Goldbach's conjecture is one of the oldest unsolved

2017-04-26 20:36:31 372

原创 lightOj 1341Aladdin and the Flying Carpet 算数基本定理

1341 - Aladdin and the Flying Carpet     PDF (English) Statistics Forum Time Limit: 3 second(s) Memory Limit: 32 MB It's said that Aladdin had to solve seven m

2017-04-26 19:58:27 252

原创 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 269

原创 天梯赛5-12 愿天下有情人都是失散多年的兄妹 【dfs】

5-12 愿天下有情人都是失散多年的兄妹   (25分) 呵呵。大家都知道五服以内不得通婚,即两个人最近的共同祖先如果在五代以内(即本人、父母、祖父母、曾祖父母、高祖父母)则不可通婚。本题就请你帮助一对有情人判断一下,他们究竟是否可以成婚? 输入格式: 输入第一行给出一个正整数N(2 \le≤ N \le 10^4≤10​4​​),随后N行,每行按以下格式给出一个人的

2017-03-23 22:00:30 1419

原创 poj2718 Smallest Difference【贪心】

Smallest Difference Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10453   Accepted: 2855 Description Given a number of distinct decimal digits, you can for

2017-03-15 19:53:55 265

原创 HDU problem 5635 LCP Array【思维】

LCP Array Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1532    Accepted Submission(s): 468 Problem Description Peter has a str

2017-03-08 18:03:52 176

原创 codeforces 782C Andryusha and Colored Balloons【构造】

C. Andryusha and Colored Balloons time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Andryusha goes through a

2017-03-07 18:13:21 299

原创 HDU 4278 Faulty Odometer【水题】

Faulty Odometer Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2017    Accepted Submission(s): 1398 Problem Description   You are

2017-03-07 18:05:08 193

原创 codeforces B. The Meeting Place Cannot Be Changed【二分】

B. The Meeting Place Cannot Be Changed time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output The main road in Byt

2017-03-06 20:27:39 370

原创 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 216

原创 HDU 1850 - Being a Good Boy in Spring Festival【Nim博弈】

Being a Good Boy in Spring Festival Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7062    Accepted Submission(s): 4276 Problem Descr

2016-12-20 19:01:33 251

原创 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 276

原创 HDU Problem 1247 Hat's Words 【字典树】

Hat’s Words Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 13908    Accepted Submission(s): 4987 Problem Description A hat’s word

2016-11-19 14:50:40 223

原创 HDU Problem 1754 I Hate It 【线段树】

I Hate It Time Limit: 9000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 67459    Accepted Submission(s): 26244 Problem Description 很多学校流行一种比较的习惯。

2016-11-18 19:16:54 151

原创 POJ - 2182 Lost Cows【线段树】

题目链接  首先,题意比较清楚,给你n-1个数,表示从2到n,其中ai表示编号为i头牛所处位置的前面有几个的序号比他小。通过这些数据,让你输出这些牛的排列顺序。 思路: 对于最后的一头牛,他肯定是(an+1),通过这个规律,可以到这推出所有牛的顺序,你可以标记,然后暴力跑一边,但是效率不高。 这里,可以用线段树进行维护。 #include #include #include #in

2016-11-16 12:54:56 161

原创 HDU - problem 1387 Team Queue【队列】

Team Queue Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 1999    Accepted Submission(s): 688 Problem Description Queues and Prior

2016-11-14 22:09:53 211

原创 hdu - Problem 1175 连连看 【bfs】

http://acm.hdu.edu.cn/showproblem.php?pid=1175 Time 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 210

原创 codeforces 233c Cycles【贪心】

Cycles time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output John Doe started thinking about graphs. After some th

2016-11-12 18:11:50 251

原创 HDU Problem - 1058 Humble Numbers 【dp】

Humble Numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24415    Accepted Submission(s): 10702 Problem Description A number

2016-11-12 15:15:17 135

原创 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 188

原创 HDU - problem Tr A 【快速幂 + 矩阵】

Tr A Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4488    Accepted Submission(s): 3377 Problem Description A为一个方阵,则Tr A表示A的迹(就是主

2016-11-01 19:45:17 166

原创 poj - problem 3070 Fibonacci 【矩阵 +快速幂】

Fibonacci Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 13732   Accepted: 9728 Description In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn

2016-11-01 19:27:43 471

原创 HDU - problem 1757 A Simple Math Problem【矩阵 + 快速幂】

A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4283    Accepted Submission(s): 2573 Problem Description Lele

2016-11-01 16:09:07 183

原创 codeforces - 732D Exams 【二分 + 贪心】

Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasiliy has an exam period which will continue for n d

2016-10-31 20:23:45 214

原创 poj - 2406 Power Strings 【KMP】

Power Strings Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 45224   Accepted: 18873 Description Given two strings a and b we define a*b to be their co

2016-10-31 13:36:43 256

原创 codeforces - 444c DZY Loves Physics【水】

DZY Loves Physics DZY 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 305

原创 hdu - 4506 小明系列故事——师兄帮帮忙 【快速幂】

小明系列故事——师兄帮帮忙 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 5596    Accepted Submission(s): 1528 Problem Description   小明自从告别了ACM

2016-10-30 14:59:23 233

原创 hdu - 5945 Fxx and game 【dp + 单调队列】

Fxx and game Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 413    Accepted Submission(s): 100 Problem Description Young theoreti

2016-10-30 12:39:17 282

原创 poj 2823 - Sliding Window【单调队列模板】

Sliding Window Time Limit: 12000MS   Memory Limit: 65536K Total Submissions: 55797   Accepted: 16048 Case Time Limit: 5000MS Description An array of size n ≤ 106

2016-10-30 09:54:38 175

原创 hdu - problem 1671 Phone List【字典树】

Phone List Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 18382    Accepted Submission(s): 6189 Problem Description Given a list o

2016-10-27 21:33:38 191

原创 hdu - problem 1251 统计难题【字典树】

统计难题 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131070/65535 K (Java/Others) Total Submission(s): 35486    Accepted Submission(s): 13269 Problem Description Ignatius最近遇到一个难题,老

2016-10-27 20:42:18 189

原创 hdu - 4324 Triangle LOVE【dfs】

Triangle LOVE Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 4610    Accepted Submission(s): 1809 Problem Description Recently, sc

2016-10-26 20:03:51 265

原创 POJ - 3041 Asteroids 【二分图匹配】

Asteroids Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 20881     Description Bessie wants to navigate her spaceship through a dangerous asteroid field

2016-10-26 18:55:17 202

原创 UVA - 1388 Graveyard 【数学】

题目链接 题意: 给一个周长为10000的圆,一开始有n个距离相等的点, 现在要添加m个点使其仍旧保持距离相等的状态,问最小的移动距离。 思路: 遍历原来的每一个点,找出离他最近的新的位置。 #include #include #include #include #include #include #include #include #include #include

2016-10-25 18:55:37 140

原创 poj - 1579 Function Run Fun 【dp】

Function Run Fun Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 18338   Accepted: 9372 Description We all love recursion! Don't we?  Consider a three-par

2016-10-22 15:40:18 189

原创 codeforces - 337c Quiz【贪心】

C. Quiz time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Manao is taking part in a quiz. The quiz consists of

2016-10-20 22:01:14 261

原创 codeforces -297c Splitting the Uniqueness【构造】

Splitting the Uniqueness time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polar bears like unique arrays — th

2016-10-19 21:54:37 189

原创 codeforces - 257c View Angle 【数学】

C. View Angle time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Flatland has recently introduced a new type o

2016-10-17 21:00:02 260

空空如也

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人 TA的粉丝

提示
确定要删除当前文章?
取消 删除