- 博客(61)
- 资源 (1)
- 收藏
- 关注
原创 乘法逆元的快捷求法
不说了,上代码int[] inv = new int[MAXN]; inv[1] = 1; for (int i = 2; i<MAXN; i++) inv[i] = inv[MOD%i]*(MOD-MOD/i)%MOD;
2015-03-07 22:36:33
518
原创 hdu 4791 RMQ
我是来存RMQ板的#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #incl
2014-10-09 20:09:43
660
原创 leetcode Wildcard Matching
Wildcard Matching Total Accepted: 14208 Total Submissions: 100593My SubmissionsImplement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Ma
2014-10-08 21:30:50
692
原创 leetcode Sudoku Solver
Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will be only one unique solution.A sudoku puzzle.
2014-10-08 12:18:37
560
原创 codeforces 271E 离散化+线段树,dp优化
E. Pillarstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMarmot found a row with n pillars. The i-th pilla
2014-10-07 18:50:14
733
原创 codeforces 474F 区间gcd + 离散化
F. Ant colonytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMole is hungry again. He found one ant colony, consistin
2014-10-07 15:50:19
1242
原创 acdream contest 1131 Burning Bridges
http://acdream.info/contest?cid=1131#overview
2014-10-07 13:39:48
664
原创 hihocoder 1041
时间限制:1000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho准备国庆期间去A国旅游。A国的城际交通比较有特色:它共有n座城市(编号1-n);城市之间恰好有n-1条公路相连,形成一个树形公路网。小Hi计划从A国首都(1号城市)出发,自驾遍历所有城市,并且经过每一条公路恰好两次——来回各一次——这样公路两旁的景色都不会错过。令小
2014-10-03 07:15:13
2033
原创 hdu 2295 DLX重复覆盖
#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include
2014-09-30 22:37:47
588
原创 codeforces 458C Elections
C. Electionstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are running for a governor in a small city
2014-08-13 22:43:10
1292
转载 矩阵乘法优化
转自:http://blog.youkuaiyun.com/gogdizzy/article/details/9003369题目地址:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1113昨晚为了优化这个题目弄到2点多,今天一早就写博,我真是太不蛋定了,哈哈。做OJ的朋友都知道快速幂,我就不罗嗦了
2014-08-13 18:19:37
1002
原创 hdu 4944
题意:for(int i=1;i for(int j = 1;j for(int k = 1;k if(i % k == 0 && j % k == 0) ans += i * j / gcd(i, j);易得dp[i] = dp[i-1] + num[i] * i;关
2014-08-13 16:30:40
743
原创 hdu 4928 Series 2
Series 2Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 499 Accepted Submission(s): 110Problem DescriptionLet A be an integ
2014-08-10 16:16:03
900
原创 codeforces 455C Civilization
C. Civilizationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndrew plays a game called "Civilization". D
2014-08-09 17:12:24
726
原创 codeforces 455B. A Lot of Games
B. A Lot of Gamestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndrew, Fedor and Alex are inventive guys.
2014-08-09 15:14:34
713
原创 hdu 4916 Count on the path
Count on the pathTime Limit: 5000/2500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 378 Accepted Submission(s): 113Problem Descriptionbobo has
2014-08-08 22:26:12
790
原创 hdu 4921 Map
MapTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 235 Accepted Submission(s): 74Problem DescriptionThere are N pieces of f
2014-08-08 16:10:05
723
原创 hdu 4923 Room and Moor
Room and MoorTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 675 Accepted Submission(s): 197Problem DescriptionPM Room def
2014-08-08 14:07:56
527
转载 hdu 4609 3-idiots (FFT)
学会了FFT。这题就很容易了。其实题目是给了n条线段。问随机取三个,可以组成三角形的概率。 其实就是要求n条线段,选3条组成三角形的选法有多少种。 首先题目给了a数组,如样例一:41 3 3 4把这个数组转化成num数组,num[i]表示长度为i的有num[i]条。样例一就是num = {0 1
2014-08-06 23:13:18
641
原创 hdu 4912 Paths on the tree
Paths on the treeTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 365 Accepted Submission(s): 111Problem Descriptionbobo has
2014-08-06 15:26:32
664
原创 hdu 4911 Inversion 树状数组求逆序数对
InversionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 389 Accepted Submission(s): 159Problem Descriptionbobo has a seque
2014-08-05 22:05:27
709
原创 hdu 4919 Exclusive or + 高精度板
Exclusive orTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 100 Accepted Submission(s): 41Problem DescriptionGiven n, find
2014-08-05 19:42:48
829
原创 hdu 4915 Parenthese sequence
Parenthese sequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 85 Accepted Submission(s): 28Problem Descriptionbobo fou
2014-08-05 19:09:50
683
原创 poj 2135 Farm Tour + 费用流vector模板
Farm TourTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11260 Accepted: 4174DescriptionWhen FJ's friends visit him on the farm, he likes to show th
2014-08-04 21:33:21
629
原创 hdu 4910 Problem about GCD
Problem about GCDTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 341 Accepted Submission(s): 52Problem DescriptionGiven integ
2014-08-04 17:58:30
691
原创 hdu 4876 ZCC loves cards
ZCC loves cardsTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1929 Accepted Submission(s): 503Problem DescriptionZCC loves p
2014-08-03 15:48:47
1024
原创 hdu 4906 Our happy ending
Our happy endingTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 700 Accepted Submission(s): 223Problem DescriptionThere is
2014-08-03 14:16:56
676
原创 acdream 1171 Matrix sum
H - Matrix sumTime Limit: 8000/4000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others)SubmitStatusProblem Descriptionsweet和zero在玩矩阵游戏,sweet画了一个N * M的矩阵,矩阵的每个格子有一个整数。zero给出N个数Ki
2014-08-02 18:26:08
584
原创 codeforces 453B Little Pony and Harmony Chest
B. Little Pony and Harmony Chesttime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPrincess Twilight went to
2014-08-02 14:47:17
636
原创 hdu 4888 Redraw Beautiful Drawings
Redraw Beautiful DrawingsTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1213 Accepted Submission(s): 243Problem DescriptionA
2014-07-30 16:21:54
558
原创 hdu 4889 Scary Path Finding Algorithm
Scary Path Finding AlgorithmTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 130 Accepted Submission(s): 47Special JudgeProblem De
2014-07-29 21:44:06
823
原创 hdu 4893 Wow! Such Sequence!
Wow! Such Sequence!Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 315 Accepted Submission(s): 95Problem DescriptionRecently
2014-07-29 21:41:04
595
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人