随笔分类 - ACM_HDOJ
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1559#include#include#includeusing namespace std;int dp[1005][1005];int main(){ int t; scanf("%d",&t); while(t--) { int m,n,x,y; int i,j; scanf("%d%d%d%d",&m,&n,&x,&y); memset(dp,0,sizeof(dp)); int maxn=-1; ...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3347C++ Map秒杀附上代码#include#include#include#include#include#includeusing namespace std;mapmp;map::iterator it;int main(){ //freopen("in.txt","r",stdin); int t; scanf("%d",&t); while(t--) { mp.clear(); int sum=0; int n; ...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3603#include#include#include#define N 300001int n;int vis[N];int pre[N];int dp[N][19];void swap(int *a,int *b){ *a+=*b; *b=*a-*b; *a-=*b;}int b_search(int x,int y){ int m; int k=0; int v=x; while(x>1; if(pre[m]b) return 0; k=(i...
阅读全文
摘要:#include#includechar s[20];int is_prime(int x){ int n; sprintf(s,"%d",x); n=strlen(s); for(int i=0;i"); printf("%d",num[j]); } break; } cnt++; } printf("\n"); } return 0;}
阅读全文
摘要:#includeint main(){char c,d;int n,N;scanf("%d",&N);getchar();//回车符要处理;while(N--){ n=1; d=getchar(); while((c=getchar())!='\n') { if(c==d){n++;} else{if(n==1)printf("%c",d); elseprintf("%d%c",n,d);d=c;n=1; } } if(n==1) printf("%c\n",d); else printf(
阅读全文

浙公网安备 33010602011771号