上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 47 下一页

2012年5月1日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1060脑筋急转弯。View Code #include <stdio.h>#include <math.h> int main(){ int t; double n; scanf("%d",&t); while(t--) { scanf("%lf",&n); printf("%d\n",(int)pow(10.0,n*log10(n)-(__int64)(n*log10(n)))); } return 0;} 阅读全文
posted @ 2012-05-01 14:25 LegendaryAC 阅读(119) 评论(0) 推荐(0) 编辑

2012年4月29日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4217经典的线段树问题,找第k小数。注意sum用__int64View Code #include <stdio.h>#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn=300000;int tree[maxn<<2];int temp;void build(int l,int r,int rt){ tree[rt]=r-l+1; if(l==r) return; int m=(l+r)& 阅读全文
posted @ 2012-04-29 22:14 LegendaryAC 阅读(328) 评论(0) 推荐(0) 编辑

2012年4月26日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2140按题意翻译字符串View Code #include <stdio.h>#include <string.h>int main(){ char tab[10][2]={{'b',' '},{'q',','},{'t','!'},{'m','l'},{'i','e'},{'c','a'},{& 阅读全文
posted @ 2012-04-26 18:09 LegendaryAC 阅读(244) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1212大整数取模问题(a+b) mod n=((a mod n)+(b mod n)) mod nView Code #include <stdio.h>#include <string.h>int main(){ char s[1100]; int n; int len,ans,i; while(~scanf("%s%d",s,&n)) { len=strlen(s); ans=0; for(i=0;i<len;i++) ... 阅读全文
posted @ 2012-04-26 17:23 LegendaryAC 阅读(189) 评论(0) 推荐(1) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2710找出拥有最大素因子的数,基本的素数筛选View Code #include <stdio.h>int prime[110000];int main(){ int t,n; int i,j; int max,maxnum; for(i=2;i*i<=100001;i++) if(!prime[i]) for(j=i;j*i<=100001;j++) prime[i*j]=1; while(~scanf("%d"... 阅读全文
posted @ 2012-04-26 16:17 LegendaryAC 阅读(283) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1339n=o*2^p,已知n,求o和p水、、、View Code #include <stdio.h>#include <string.h>int main(){ int t,n; int cnt; scanf("%d",&t); while(t--) { scanf("%d",&n); if(n%2) printf("%d 0\n",n); else { cnt=0; ... 阅读全文
posted @ 2012-04-26 13:06 LegendaryAC 阅读(155) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1391水View Code #include <stdio.h>#include <string.h>int main(){ int t; int x,y; scanf("%d",&t); while(t--) { scanf("%d%d",&x,&y); if(x!=y&&x!=y+2) puts("No Number"); else { if(y%2) ... 阅读全文
posted @ 2012-04-26 12:48 LegendaryAC 阅读(132) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1496今天刚知道这种方法叫哈希。。。开始没考虑清楚边界,各种错,A了再看也就那么回事View Code #include <stdio.h>#include <string.h>const int N=1000000;int hash[2000001];int main(){ int a,b,c,d; int ans; int i,j; while(~scanf("%d%d%d%d",&a,&b,&c,&d)) { if((a> 阅读全文
posted @ 2012-04-26 12:33 LegendaryAC 阅读(179) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1491无聊题View Code #include <stdio.h>int main(){ int t,i; int month,day,now; int tab[11]={0,31,28,31,30,31,30,31,31,30}; scanf("%d",&t); while(t--) { scanf("%d%d",&month,&day); if(month>10||(month==10&&day>21 阅读全文
posted @ 2012-04-26 11:18 LegendaryAC 阅读(194) 评论(0) 推荐(0) 编辑

2012年4月25日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1176类似数塔的dp,注意边界处理!!!View Code #include <stdio.h>#include <string.h>int dp[110000][30];int max3(int a,int b,int c){ int maxnum=a; if(maxnum<b)maxnum=b; if(maxnum<c)maxnum=c; return maxnum;}int max2(int a,int b){ return a>b?a:b;}int main( 阅读全文
posted @ 2012-04-25 22:12 LegendaryAC 阅读(151) 评论(0) 推荐(0) 编辑
上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 47 下一页