随笔分类 - 算法竞赛
摘要:给定一个小于5000000的数,将之分解为至多4个数的平方和。 #include<bits/stdc++.h> #define maxn 5000005 using namespace std; bool a2b2[maxn]; int main() { memset(a2b2,0,sizeof(a
阅读全文
摘要:To The Max Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12471 Accepted Submission(s): 5985 Pro
阅读全文
摘要:#include #include #define maxv 1000 #define inf 0x3fffffff using namespace std; int d[maxv][maxv];//d[u][v]表示边e=(u,v)的权值,不存在是设为inf,d[x][x]=0 int V; void floyd() { for(int k=0;k<V;k++) { ...
阅读全文
摘要:#include #include #define maxv 100 #define inf 0x3fffffff using namespace std; int cost[maxv][maxv]; int d[maxv]; bool used[maxv]; int V; void dijkstra(int s) { for(int i=0;id[v]+cost[v][u]) ...
阅读全文
摘要:#include #include #define maxn 1000 #define inf 0x3fffffff using namespace std; struct Edage { int from; int to; int cost; }es[maxn]; int d[maxn]; int v,e; //无负圈,求单源最短路 /* 单源最短路:从一个点s到其他...
阅读全文
摘要:动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说
阅读全文
摘要:Fence Repair Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 42979 Accepted: 13999 Description Farmer John wants to repair a small length o
阅读全文
摘要:Saruman's Army Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8477 Accepted: 4317 Description Saruman the White must lead his army along a
阅读全文
摘要:lunix系统下中文支持没有配出来,注释的时候直接用英语了,直接翻译过来就行。。。唉,英语渣的痛谁都懂 flag{svg_C4P7cHa_n0t_$ecUr3}
阅读全文
摘要:An easy problem Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description When Teddy was a child , he was always
阅读全文
摘要:Delta-wave Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8166 Accepted Submission(s): 3219 Prob
阅读全文

浙公网安备 33010602011771号