
水题
winkloud
这个作者很懒,什么都没留下…
展开
-
hdu 2352 Verdis Quo
大意:按照所给规律,将罗马数字转化为十进制数字//Memory: 220K//Time: 15MS #include #include int main(){ int cas; scanf("%d",&cas); while(cas--) { int sum=0; char a[50]; scanf("%s",&a); int l=strlen(a);原创 2012-08-07 21:30:30 · 645 阅读 · 0 评论 -
POJ 2406 Power Strings (判字符串相同)
直接暴力就可以,注意暴力也要判断下,循环的长度要可以被总长整除再暴力啊。。//Memory: 1160K //Time: 266MS#include #include using namespace std;char str[1000005];int main(){ while(cin>>str) { if(str[0]=='.') break; int原创 2012-08-09 10:29:51 · 379 阅读 · 0 评论 -
HDU 1234 开门人和关门人 (比较大小)
水题,比较时间大小就可以了。字符串比较或者数字比较都行//Memory: 264 KB //Time: 15 MS#include #include #include using namespace std;int main(){ int cas; scanf("%d",&cas); while(cas--) { int n,j; int start,end;原创 2012-08-08 14:26:36 · 636 阅读 · 0 评论 -
POJ 2029 Get Many Persimmon Trees (标记)
给一个长宽已知的矩形,要求围起最多的树。数据量只有100*100,标记树的位置,暴力枚举所有的矩形找最大值就可以了//Memory: 188 KB //Time: 0 MS#include #include bool map[101][101];int max(int a,int b){ return a>b?a:b;}int main(){ int n,w,h,s,t原创 2012-08-09 10:33:52 · 479 阅读 · 0 评论 -
HDU 1396 Counting Triangles (找规律)
其实就是找规律。。先找正的三角形,再找倒的三角形//Memory: 488 KB //Time: 15 MS#includeusing namespace std;int main(){ int n,sum; while(cin>>n) { sum=0; for(int i=1;i<=n;i++)原创 2012-08-08 14:38:36 · 1001 阅读 · 0 评论 -
HDU 3123 GCC(模运算)
求阶乘取模的值。实际上这题的数据量不大,64位整形就可以了。代码没什么难度。2个公式:a%m+b%m=(a+b)%m;(a%m)*(b%m)=(a*b)%m;//Time : 203MS //Memory : 224K#include#includeusing namespace std;int main(){ __int64 sum,mod; int max,m,原创 2012-08-07 22:18:00 · 692 阅读 · 0 评论 -
HDU 4161 Iterated Difference (模拟+递推)
给出一串数,这串数的下一个状态的每一位都由上个状态的后一位的绝对值减这一位的绝对值得到,求经过多少次状态这串数均变成0;//Time : 203MS //Memory : 224K#include int sum=-1;int dif(int a[],int n){ int i,s=0; bool zero=true; sum++; for(i=0;i<n-1;i++) { i原创 2012-08-07 22:10:58 · 683 阅读 · 0 评论 -
POJ 3125 Printer Queue
很简单的模拟,却被我做的很复杂。。其实做一个队列按照题目说明来循环就可以了//memory 208k//time 16MS#include using namespace std;int main(){ //freopen("1.in","r",stdin); //freopen("out.txt","w",stdout); int cas,i,j,k,n,m,num; i原创 2012-08-07 18:49:48 · 419 阅读 · 0 评论 -
POJ 2109 Power of Cryptography (大数开方)
可能很多人被10^100的数据吓到了,不知道怎么上手其实这题很容易的,double的数据可以达到10^300 啊另外,a的1/7次方,就是对a求7次根。。//Memory: 168 KB //Time: 0 MS#include#includeint main(){ double n,p; while(scanf("%lf%lf",&n,&p)!=EOF) { d原创 2012-08-08 12:09:51 · 551 阅读 · 0 评论 -
POJ 2092 Grandpa is Famous (sort排序)
题目大意:爷爷是大神,现在大神要入吉尼斯,但是有人和大神竞争啊,大神想知道有谁和他竞争。输入N*M,N就是N次比赛,M是个人成绩,也是个人身份。N次比赛中出现次数最多的就是大神,要输出出现次数仅此于大神的所有人。解法:明白题意很好做,水题一道,一个sort就解决了//Memory: 200 KB //Time: 204 MS#include #include #include原创 2012-08-08 11:53:31 · 1810 阅读 · 0 评论 -
hdu 3174 logo (已知角度求点)
如此一道水题,比赛时居然卡了我3个小时。。天啊!!思维定式要人命啊!!//Time:15MS //Memory:244K#include #include #include const double PI=acos(-1.0);double x,y,th;void fd(int l){ x+=l*sin(2*PI*th/360); y+=l*cos(2*PI*th/36原创 2012-08-26 23:05:23 · 905 阅读 · 0 评论