Code Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 300 Accepted Submission(s): 124 Problem Description WLD likes playing with codes.One day he is writing a function.Howerver,his computer b…
Code Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description WLD likes playing with codes.One day he is writing a function.Howerver,his computer breaks down because the function is too powerful.He is ve…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3461 A lock you use has a code system to be opened instead of a key. The lock contains a sequence of wheels. Each wheel has the 26 letters of the English alphabet 'a' through 'z', in order. If you move a…
2019 杭电多校 1 1013 题目链接:HDU 6590 比赛链接:2019 Multi-University Training Contest 1 Problem Description After returning with honour from ICPC(International Cat Programming Contest) World Finals, Tom decides to say goodbye to ICPC and start a new period of l…
Code Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1306 Accepted Submission(s): 540 Problem Description WLD likes playing with codes.One day he is writing a function.Howerver,his computer b…
#include<stdio.h> #include<math.h> ]; int count; #define mod 1000000007 int find(int x) { int r=x; while(r!=set[r]) r=set[r]; int i=x; while(i!=r) { int j=set[i]; set[i]=r; i=j; } return r; } void merge(int x,int y) { int fx=find(x); int fy=fi…
题意:考虑由$n$个结点构成的无向图,每条边的长度均为$1$,问有多少种构图方法使得结点$1$与任意其它节点之间的最短距离均不等于$k$(无法到达时距离等于无穷大),输出答案对$1e9+7$取模.$1 \leq n, k \leq 60$. 分析:只需要考虑那些和结点$1$在同一个连通块的结点,考虑对包含结点$1$的连通图的等价类划分:首先是结点数目,其次是所有结点到达结点$1$的最短距离的最大值,再次是最短距离等于该最大值的结点数目,因此用$dp(i, j, k)$表示与$1$在同一个连通分量…
HDU 1000 A + B Problem I/O HDU 1001 Sum Problem 数学 HDU 1002 A + B Problem II 高精度加法 HDU 1003 Maxsum 贪心 HDU 1004 Let the Balloon Rise 字典树,map HDU 1005 Number Sequence 求数列循环节 HDU 1007 Quoit Design 最近点对 HDU 1008 Elevator 模拟 HDU 1010 Tempter of th…
The kth great number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 6020 Accepted Submission(s): 2436 Problem Description Xiao Ming and Xiao Bao are playing a simple Numbers game. In a round…
hdu5901题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5901 code vs 3223题目链接:http://codevs.cn/problem/3223/ 思路:主要是用了一个Meisell-Lehmer算法模板,复杂度O(n^(2/3)).讲道理,我不是很懂(瞎说什么大实话....),下面输出请自己改 #include<bits/stdc++.h> using namespace std; typedef long long LL;…
http://acm.hdu.edu.cn/showproblem.php?pid=5375 Gray code Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 988 Accepted Submission(s): 551 Problem Description The reflected binary code, also kn…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5375 题面: Gray code Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 626 Accepted Submission(s): 369 Problem Description The reflected binary cod…
Secret Code Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 670 Accepted Submission(s): 109 Problem Description The Sarcophagus itself is locked by a secret numerical code. When somebody wan…
as Scott Meyers said in his book Effective STL, "My advice on choosing among the sorting algorithms is to make your selection based on what you need to accomplish, not on performance considerations. If you choose an algorithm that does only what you…
Hard Code Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=95149#problem/A Description Some strange code is sent to Da Shan High School. It's said to be the prophet's note. The note is extremely hard t…
题目链接:HDOJ - 5212 题目分析 首先的思路是,考虑每个数对最终答案的贡献. 那么我们就要求出:对于每个数,以它为 gcd 的数对有多少对. 显然,对于一个数 x ,以它为 gcd 的两个数一定都是 x 的倍数.如果 x 的倍数在数列中有 k 个,那么最多有 k^2 对数的 gcd 是 x . 同样显然的是,对于两个数,如果他们都是 x 的倍数,那么他们的 gcd 一定也是 x 的倍数. 所以,我们求出 x 的倍数在数列中有 k 个,然后就有 k^2 对数满足两个数都是 x 的倍数,这…