contest
大道殊同
野生程序员
展开
-
LQB 2K
#include #include#include #include#include#define LL long long#define Pi acos(-1.0)using namespace std;const int inf=-600000000;int a[1010];int main(){ int n; while(scanf("%d",&n)&&n) {原创 2017-03-18 18:01:26 · 175 阅读 · 0 评论 -
玲珑杯#11 D 1099 - 萌萌哒的第四题
1099 - 萌萌哒的第四题Time Limit:2s Memory Limit:128MByteSubmissions:427Solved:260DESCRIPTION给一个数x,定义一个函数f(x)的结果是x的各位数字的平方和,若经过无数次递归操作之后若结果为1,也就是f(f(f(...f(x)...)))=1,那么这个数被认为是一个特别的数。给出一个数x请原创 2017-03-06 08:33:05 · 164 阅读 · 0 评论 -
玲珑杯#11 D 1099 - 萌萌哒的第四题
1099 - 萌萌哒的第四题Time Limit:2s Memory Limit:128MByteSubmissions:427Solved:260DESCRIPTION给一个数x,定义一个函数f(x)的结果是x的各位数字的平方和,若经过无数次递归操作之后若结果为1,也就是f(f(f(...f(x)...)))=1,那么这个数被认为是一个特别的数。给出一个数x请原创 2017-03-06 08:35:06 · 162 阅读 · 0 评论 -
HPU 1285: Vegetable and Road again
修路的方案终于确定了。市政府要求任意两个公园之间都必须实现公路交通(并不一定有直接公路连接,间接公路相连也可以)。但是考虑到经济成本,市政府希望钱花的越少越好。你能帮助Vegetable找到给出的修路方案所需的最少花费吗?输入有T组测试数据。每组包含一组N(0接下来给出M行,每行包括A,B, C。表示A和B之间修公路需要花费C元。输出若给出的原创 2017-03-06 09:03:42 · 228 阅读 · 0 评论 -
HPU 1284: Vegetable and Road
题目描述公园终于建好了,市政府要求任意两个公园之间必须连通,即公园A到公园B至少有一条马路(并不是要求直接相连,可以通过其他公园间接相连)。 Vegetable接下来这个任务,并设计出了对应的修路方案,下面你需要判断Vegetable的方案是否可行。注意:两个公园直接可以存在多条路。输入有T组测试数据,每组测试数据有一组N(0N表示有N个公园,编原创 2017-03-06 09:10:45 · 226 阅读 · 0 评论 -
HPU 1276: QAQ and steel ball discs
题目描述"江山如画,无人许我一世繁华;墓柩之大,方寸之间亦是天下。"QAQ终究还是没能耐得住寂寞,和小伙伴一起踏上了盗墓之路......QAQ和小伙伴一起来到了一个古老的青铜门前,门宽五丈五,高六丈,门中间却有一个由钢珠组成的圆盘,深藏不露QAQ一眼看出这就是传说中的钢珠圆盘,什据古书记载,破局者每次可从中取走一个或两个钢珠,而此圆盘每次亦会每次消失一颗或两颗钢珠,而走或原创 2017-03-06 12:50:26 · 423 阅读 · 0 评论 -
训练
点击打开链接原创 2017-03-06 13:38:11 · 221 阅读 · 0 评论 -
LQB 1A
DescriptionYuta gives Rikka a chess board of size $n \times m$. As we all know, on a chess board, every cell is either black or white and every two cells that share a side have different color原创 2017-03-06 21:52:27 · 183 阅读 · 0 评论 -
LQB 1D
Description"How am I ever going to solve this problem?" said the pilot.Indeed, the pilot was not facing an easy task. She had to drop packages at specific points scattered in a dangerous are原创 2017-03-08 10:47:55 · 199 阅读 · 0 评论 -
LQB 1E
DescriptionFJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list with one fewer原创 2017-03-08 11:31:16 · 178 阅读 · 0 评论 -
LQB 1K
#include #include#include#define LL long longusing namespace std;int main(){ int t; scanf("%d",&t); while(t--) { int n,m,z,l; scanf("%d%d%d%d",&n,&m,&z,&l); LL ans=0,a=0; for(int i=1原创 2017-03-10 22:20:59 · 190 阅读 · 0 评论 -
LQB 2H
#include#include#include#define LL long longint sol(int m,int n)//m个苹果n个盘子 { if(n==1||m==0) return 1; else if(n>m) return sol(m,m); else return sol(m-n,n)+sol(m,n-1);}int main(){ in原创 2017-03-13 08:22:15 · 186 阅读 · 0 评论 -
LQB 2D
#include #include#include #include#includeusing namespace std;int sol(int a[],int l){ int x=0,y=0; int Min=1<<25; if(l==1) return a[1]; if(l==2) return abs(a[1]-a[2]); while(a[1]==0)原创 2017-03-15 12:03:39 · 163 阅读 · 0 评论 -
LQB 2E
#include #include#include #include#include#define LL long longusing namespace std;int pow(int a,int b){ LL ans=1; for(int i=1;i<=b;i++) ans=ans*a; return ans;}int main(){ int n; wh原创 2017-03-15 22:07:59 · 264 阅读 · 0 评论 -
LQB 2L
#include #include#include#define LL long longusing namespace std;struct set{ int a,b;};bool cmp(set A,set B){ return A.b<=B.b;}int main() { int n; while(scanf("%d",&n)!=EOF) { set s原创 2017-03-17 13:29:57 · 188 阅读 · 0 评论 -
LQB 2I
#include #include#include #include#define LL long long#define Pi acos(-1.0)using namespace std;int main(){ double n,R,r; while(scanf("%lf%lf%lf",&n,&R,&r)!=EOF) { if(r>R) printf("NO\n"原创 2017-03-18 15:54:31 · 173 阅读 · 0 评论 -
CF #403 Div.2 A
A. Andryusha and Sockstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndryusha is an orderly boy and likes to keep原创 2017-03-06 08:23:58 · 221 阅读 · 0 评论