rt,直接猜1
First Digit
Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge
Benford's Law, also called the First-Digit Law, refers to the frequency distribution of digits i...
分类:
其他好文 时间:
2014-06-20 13:04:39
阅读次数:
277
Burn the Linked Camp
It is well known that, in the period of The Three Empires, Liu Bei, the emperor of the Shu Empire, was defeated by Lu Xun, a general of the Wu Empire. The defeat was due to Liu B...
分类:
其他好文 时间:
2014-06-20 12:57:12
阅读次数:
240
n个点,m条边
每条边两个整数a、b,表示a到b的有向边
求,至少需要几个集合,使得:每个集合中的元素互相不能到达
N(1≤ N≤ 100000), M(1≤ M≤ 300000)...
分类:
其他好文 时间:
2014-06-20 11:52:46
阅读次数:
175
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=151For each list
of words, output a line with each word reversed without changing the or...
分类:
其他好文 时间:
2014-06-10 00:14:19
阅读次数:
300
题意:贪吃蛇的题目
思路:BFS+状态的记录,坑了无数发,#include
#include
#include
using namespace std;
const int MAXN = 500000;
bool flag[8],vis[25][25],mp[21][21][16384];
int n,m,l;
int xx[4]={-1,0,1,0}; // up,right,dow,left...
分类:
其他好文 时间:
2014-06-08 10:13:19
阅读次数:
204
给n个人的年龄大小关系,问最少分几组使每个组里面人的年龄不能直接或间接的比较。
每个联通块里的人都得分到不同的组,缩点后找最长的链即答案
tarjian缩点+dp找最长路
Grouping
Time Limit: 2 Seconds Memory Limit: 65536 KB
Suppose there are N people in ZJU, who...
分类:
其他好文 时间:
2014-06-08 09:44:30
阅读次数:
321
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1072
题目大意:
走迷宫,初始剩余时间为6min,每步1min;到reset区是若剩余时间大于0,则可以重置。到终点3区,若时间大于0,则成功逃脱。(可以走回路)
0:wall
1:可以走
2:起点
3:终点
4:剩余时间重置为6
源代码:
#include
#inc...
分类:
Web程序 时间:
2014-06-07 13:39:38
阅读次数:
298
离散化+暴力
Consecutive Blocks
Time Limit: 2 Seconds Memory Limit: 65536 KB
There are N (1 ≤ N ≤ 105) colored blocks (numbered 1 to N from left to right) which are lined up in a row. An...
分类:
其他好文 时间:
2014-06-07 13:08:07
阅读次数:
193
/*
ID:kevin_s1
PROG:sprime
LANG:C++
*/
//N = 1只可能为2,3,5,7,N > 1只可能为1,3,7,9. N = i,到N = i + 1递推如果是素数就扩展,类似于BFS#include
#include
#include
#include
#include
#include
#include
#include
#include
#...
分类:
其他好文 时间:
2014-06-07 11:55:15
阅读次数:
187
并查集,
删除节点操作,可以用新建节点代替
维护每个点到跟节点的距离
Gears
Time Limit: 2 Seconds Memory Limit: 65536 KB
Bob has N (1 ≤ N ≤ 2*105) gears (numbered from 1 to N). Each gear can rotate clockwise or co...
分类:
其他好文 时间:
2014-06-07 11:33:37
阅读次数:
227