自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 收藏
  • 关注

原创 HDU-4081-Qin Shi Huang's National Road System(次小生成树)

InputThe first line contains an integer t meaning that there are t test cases(t For each test case:The first line is an integer n meaning that there are n cities(2 Then n lines follow. Each li

2016-04-29 20:49:04 343

原创 POJ-1679-The Unique MST(次小生成树)

Language:DefaultThe Unique MSTTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 26364 Accepted: 9419DescriptionGiven a connected undirected graph, t

2016-04-29 18:47:03 371

原创 SDUT-2878-Circle(概率DP/高斯消元)

CircleTime Limit: 2000ms   Memory limit: 65536K  有疑问?点这里^_^题目描述You have been given a circle from 0 to n - 1. If you are currently at x, you will move to (x - 1) mod n or (x + 1

2016-04-28 21:27:20 358

原创 HDU-4612-Warm up(无向图缩点+直径)

Warm upTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 5623    Accepted Submission(s): 1268Problem Description  N planets are conne

2016-04-28 19:15:54 1770

原创 HDU-5668-Circle(中国余数定理/解同余方程组)

CircleTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 320    Accepted Submission(s): 102Problem Description    Satiya August is in

2016-04-26 20:33:28 4761

原创 HDU-5673-Robot(卡特兰数+逆元 / 默慈金数)

RobotAccepts: 38Submissions: 146Time Limit: 12000/6000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)问题描述有一个机器人位于坐标原点上。每秒钟机器人都可以向右移到一个单位距离,或者在原地不动。如果机器人的当前位置在原点右

2016-04-26 15:52:37 668

原创 HDU-5672-String(模拟/追赶)

StringTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 918    Accepted Submission(s): 295Problem DescriptionThere is a string S.S o

2016-04-26 13:23:27 306

原创 BZOJ-2038-[2009国家集训队]小Z的袜子(hose)(莫队)

2038: [2009国家集训队]小Z的袜子(hose)Time Limit: 20 Sec  Memory Limit: 259 MBSubmit: 6232  Solved: 2885[Submit][Status][Discuss]Description作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人

2016-04-25 20:47:53 321

原创 CF-617E-XOR and Favorite Number(莫队)

E. XOR and Favorite Numbertime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBob has a favorite number k and

2016-04-25 13:54:23 631

原创 ZOJ-3939-The Lucky Week(日期循环节)

The Lucky WeekTime Limit: 2 Seconds      Memory Limit: 65536 KB Edward, the headmaster of the Marjar University, is very busy every day and always forgets the date.There was one day Ed

2016-04-24 17:19:38 623

原创 ZOJ-3946-Highway Project(最短路)

Highway ProjectTime Limit: 2 Seconds      Memory Limit: 65536 KB Edward, the emperor of the Marjar Empire, wants to build some bidirectional highways so that he can reach other cities from

2016-04-24 13:36:05 633 1

原创 HDU-5667-Sequence(矩阵快速幂+费马小定理)

SequenceTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 980    Accepted Submission(s): 315Problem Description    Holion August wil

2016-04-20 13:52:15 660

原创 NJUST-1923-triple(Mobius反演)

triple Time Limit: 3000MSMemory Limit: 65536KBDescription给出一个整数n,表示1,2,...,n。从这n个数中任意选择3个不同的数字x,y,z,问x,y,z的最大公约数等于m的方案有多少种?(注意:(1,2,3),(1,3,2),(2,1,3),(2,3,1),(3,1,2),(3,2,1)属于同一种方案)

2016-04-19 18:33:15 352

原创 HDU-1695-GCD(Mobius反演/容斥)

Sample Input21 3 1 5 11 11014 1 14409 9 Sample OutputCase 1: 9Case 2: 736427HintFor the first sample input, all the 9 pairs of numbers are (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),

2016-04-19 18:21:33 591

原创 HDU-5135-Co-prime(容斥原理)

题意:求[a,b]区间内与n互质的个数容斥原理、先对n分解质因数,分别记录每个质因数,那么所求区间内与某个质因数不互质的个数就是n/r(i),假设r(i)是r的某个质因子 假设只有三个质因子,总的不互质的个数应该为p1+p2+p3-p1p2-p1p3-p2p3+p1p2*p3, 及容斥原理,pi代表n/r(i),即与某个质因子不互质的数的个数,当有更多个质因子的时候,可以用状态压缩解决

2016-04-18 20:12:39 347

原创 ZOJ-3469-Food Delivery(区间DP)

DescriptionWhen we are focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At this time, we may call for food delivery.Suppose there are

2016-04-16 14:47:01 505

原创 HDU-3081-Marriage Match II(最大流+并查集+二分)

Marriage Match IITime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3357    Accepted Submission(s): 1078Problem DescriptionPresumably,

2016-04-13 19:46:07 620

原创 HDU-4289-Control(最大流+拆点)

ControlTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2603    Accepted Submission(s): 1120Problem Description  You, the head of Dep

2016-04-12 16:55:06 401

原创 HDU-4292-Food(最大流)

FoodTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4452    Accepted Submission(s): 1507Problem Description  You, a part-time dining

2016-04-12 15:30:51 461

原创 HDU-5661-Claris and XOR

Sample Input21 2 3 45 7 13 15 Sample Output611HintIn the first test case, when and only when $x=2,y=4$, the value of $x~XOR~y$ is the maximum.In the second test case, when and o

2016-04-10 14:20:07 717

原创 POJ-2195-Going Home(最小费用最大流/二分图)

Going HomeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20717 Accepted: 10502DescriptionOn a grid map there are n little men and n houses. In each u

2016-04-09 14:47:59 224

原创 POJ-1149-PIGS(最大流)

InputThe first line of input contains two integers M and N, 1 The next line contains M integeres, for each pig-house initial number of pigs. The number of pigs in each pig-house is greater or eq

2016-04-08 13:08:36 262

原创 POJ-1273-Drainage Ditches(最大流)dinic实现 后续模板待补充

Sample Input5 41 2 401 4 202 4 202 3 303 4 10Sample Output50#include #include #include #include #include #include #include #include #include #include #include #include us

2016-04-06 20:38:58 308

原创 POJ-1743-Musical Theme(后缀数组+二分)

Sample Input3025 27 30 34 39 45 52 60 69 79 69 60 52 45 39 34 30 26 22 1882 78 74 70 66 67 64 60 65 800Sample Output5大致题意:求不可重叠最长重复子串  参考 国家集训队论文:算法合集之《后缀数组——处理字符串的有力工具》 先二分答案,

2016-04-05 21:33:33 291

原创 POJ-2774-Long Long Message(后缀数组)

InputTwo strings with lowercase letters on two of the input lines individually. Number of characters in each one will never exceed 100000.OutputA single line with a single integer number – w

2016-04-05 15:40:51 412

空空如也

空空如也

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

TA关注的人

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