2012年4月22日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2317题意:判断做不做广告。胡搞题,看眼sample凑活一写就过了View Code #include <stdio.h>int main(){ int n,r,e,c,f; scanf("%d",&n); while(n--) { scanf("%d%d%d",&r,&e,&c); f=r-e+c; if(f<0)puts("advertise"); else if(f==0)puts(" 阅读全文
posted @ 2012-04-22 22:04 LegendaryAC 阅读(211) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1257和POJ和2533一模一样。。。View Code #include <stdio.h>#include <string.h>#include <stdlib.h>int cmp(const void*a,const void*b){ return *(int*)b-*(int*)a;}int main(){ int n,i,j; int a[1100],dp[1100]; while(~scanf("%d",&n)) { for(i=0; 阅读全文
posted @ 2012-04-22 21:14 LegendaryAC 阅读(174) 评论(0) 推荐(0) 编辑
 
摘要: http://poj.org/problem?id=2533最长上升子序列,dpView Code #include <stdio.h>#include <string.h>#include <stdlib.h>int cmp(const void*a,const void*b){ return *(int*)b-*(int*)a;}int main(){ int n,i,j; int a[1100],dp[1100]; while(~scanf("%d",&n)) { for(i=0;i<n;i++) scanf(&quo 阅读全文
posted @ 2012-04-22 20:55 LegendaryAC 阅读(157) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1163脑袋疼的厉害,写完没调试直接交,居然把%d写成%c,导致wa一次。。。这题感觉前两天刚做过一道一样的。。。HDOJ的题目很多无脑重复啊。。View Code #include <stdio.h>int main(){ int n; int i,s; while(scanf("%d",&n),n) { s=1; for(i=0;i<n;i++) s=s*n%9; if(s==0) printf("... 阅读全文
posted @ 2012-04-22 16:29 LegendaryAC 阅读(166) 评论(0) 推荐(0) 编辑