摘要: 题目:http://poj.org/problem?id=1008 玛雅人历法的一道题。 不愧是POJ,看上去的一道水题都能这么恶心...这题WA了好多次 最早是漏了uayet 这个月份 然后是一年的最后一天当成了下一年 下面这组数据: 输入:4. uayet 259 输出:13 ahau 364 只要过了这组数据就没问题了...#include <iostream>#include <string>#include <stdio.h>#include <cstdlib>using namespace std;string hname[19]={ 阅读全文
posted @ 2013-01-31 23:51 Daniel Qiu 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 题目:http://poj.org/problem?id=1007 根据逆序数排序#include <iostream>#include <string>#include <stdio.h>#include <cstdlib>using namespace std;struct DNA{ string str; int rank;}dna[105];int cmp(const void *a,const void *b){ return ((struct DNA *)a)->rank-((struct DNA *)b)->rank;} 阅读全文
posted @ 2013-01-31 18:34 Daniel Qiu 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 题目:http://poj.org/problem?id=1006思路:中国剩余定理#include <iostream>#include <stdio.h>using namespace std;int main(){ int p,e,i,d; int c=1; while(1) { cin>>p>>e>>i>>d; if(p==-1) break; int n; n=(5544*p+14421*e+1288*i-d+21252)%(23*28*33); if(n==0) n=21252; ... 阅读全文
posted @ 2013-01-31 14:07 Daniel Qiu 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 题目:http://poj.org/problem?id=1005水题#include <iostream>#include <stdio.h>#include <algorithm>#include <string>#include <string.h>#include <cstdlib>#include <cmath>using namespace std;const double PI=3.1415926;int main(){ int n; cin>>n; for(int i=1;i< 阅读全文
posted @ 2013-01-31 00:12 Daniel Qiu 阅读(102) 评论(0) 推荐(0) 编辑