2013年5月18日

摘要: /*ID: aznfy1PROG: dualpalLANG: C++*/#include<stdio.h>#include<string.h>#include<iostream>using namespace std;int num[500];int len;void change(int x,int b){ int i=0; while(x!=0) { num[i]=x%b; x=x/b; i++; } len=i;}int judge(){ for(int i=0;i<len/2;i++) { ... 阅读全文
posted @ 2013-05-18 15:21 Fray 阅读(141) 评论(0) 推荐(0) 编辑
摘要: /*ID: aznfy1PROG: palsquareLANG: C++*/#include<stdio.h>#include<string.h>#include<iostream>using namespace std;int num[20];int len;int flag;void change(int x,int b){ int i=0; while(x!=0) { num[i]=(x%b); x=x/b; i++; } len=i;}int main(){ freopen("palsquare.in","r... 阅读全文
posted @ 2013-05-18 15:04 Fray 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 将字典里的字母转换成数字,再与输入的数字进行比较,但是如果出现了输入的数字位数小于字典中某个数字,但是输入的数字有的几位全都一样,strcmp会判定相等,所以要排除这种特殊的情况。例如 输入426 应当输出 HAM HAO IAN 如果没有排除那种情况,会多输出一个字符串AC代码/*ID: aznfy1PROG: namenumLANG: C++*/#include<stdio.h>#include<string.h>#include<algorithm>#include<iostream>using namespace std;char num 阅读全文
posted @ 2013-05-18 11:59 Fray 阅读(585) 评论(0) 推荐(0) 编辑
摘要: /*ID: aznfy1PROG: transformLANG: C++*/#include<stdio.h>#include<string.h>#include<algorithm>#include<iostream>#include<string.h>#define clr(a,b); memset(a,b,sizeof(a));using namespace std;char newgraph[20][20];char oldgraph[20][20];char buf[20][20];char want[20][20];int 阅读全文
posted @ 2013-05-18 11:55 Fray 阅读(124) 评论(0) 推荐(0) 编辑

2013年5月16日

摘要: 这么水的代码也能过,USACO的数据弱爆了/*ID: aznfy1PROG: milk2LANG: C++*/#include<stdio.h>#include<string.h>#include<iostream>#include<algorithm>using namespace std;struct node{ int start; int over;}farmer[6000];bool compare(const node &a,const node &b){ if(a.start==b.start) return a.o 阅读全文
posted @ 2013-05-16 22:44 Fray 阅读(107) 评论(0) 推荐(0) 编辑
摘要: /*ID: aznfy1PROG: beadsLANG: C++*/#include<stdio.h>#include<string.h>#include<iostream>using namespace std;char necklace[500];int n,ans;int left(int num){ int ttl=0;int ad=num; char color=necklace[num]; while((necklace[ad]==color||necklace[ad]=='w')&&ttl<n) { ad- 阅读全文
posted @ 2013-05-16 22:43 Fray 阅读(126) 评论(0) 推荐(0) 编辑

2013年5月15日

摘要: 蔡勒(Zeller)公式,是一个计算星期的公式,随便给一个日期,就能用这个公式推算出是星期几。http://baike.baidu.com/view/598757.htm 阅读全文
posted @ 2013-05-15 22:57 Fray 阅读(141) 评论(0) 推荐(0) 编辑
摘要: /*ID: aznfy1PROG: fridayLANG: C++*/#include<stdio.h>#include<string.h>#include<iostream>#define clr(a,b); memset(a,b,sizeof(a));using namespace std;int dayofmonth[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};int week[7];int isleap(int x){ if(x%4==0&&x%100!=0) return 1; else 阅读全文
posted @ 2013-05-15 22:56 Fray 阅读(156) 评论(0) 推荐(0) 编辑
摘要: /*ID: aznfy1PROG: gift1LANG: C++*/#include <string.h>#include <algorithm>#include <string>#include <iostream>#include <map>#include <stdio.h>#define clr(a,b); memset(a,b,sizeof(a));using namespace std;string name;char s[100][20];string tmp;int have,givenum;map< 阅读全文
posted @ 2013-05-15 20:58 Fray 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 今天开始切USACO 加油/*ID: aznfy1PROG: rideLANG: C++*/#include <iostream>#include <fstream>#include <string>#include <stdio.h>using namespace std;char a[10],b[10];int main(){ freopen("ride.in","r",stdin); freopen("ride.out","w",stdout); while(g 阅读全文
posted @ 2013-05-15 20:57 Fray 阅读(136) 评论(2) 推荐(0) 编辑

导航