为什么要开__int64 巨巨在哪~
# include <stdio.h> # include <algorithm> # include <string.h> using namespace std; int main () { __int64 count; int i,len,cot,cot1,j,flag,n; char a[1001][1030]; while(~scanf("%d",&n)) { getchar(); flag=0; count=1; cot1=1; int flag1=0; for(i=0;i<n;i++) { gets(a[i]); len=strlen(a[i]); for(j=0;j<len;j++) { if(a[i][j]=='{') flag=1; if(a[i][j]=='}') flag=0; if(flag) { if(a[i][j]=='|') cot1++; } else { count*=cot1; if(count>100000) { flag1=1; } cot1=1; } } } if(flag1) printf("doge\n"); else { cot=0; cot1=1; flag=0; for(i=0;i<n;i++) { len=strlen(a[i]); for(j=0;j<len;j++) { if(a[i][j]=='$') cot++; if(cot%2) { if(a[i][j]==' ') cot1++; else { count*=cot1; cot1=1; if(count>100000) { flag=1; printf("doge\n"); break; } } } else { count*=cot1; cot1=1; if(count>100000) { flag=1; printf("doge\n"); break; } } } if(flag) break; } if(!flag) printf("%I64d\n",count); } } return 0; }
hdu 4891 The Great Pan (模拟),布布扣,bubuko.com
时间: 2024-12-29 15:19:17