/ Vijos /

记录详情

Compile Error

foo.cpp:1:1: error: 'include' does not name a type
 include<cstdio> include<cstring> 
 ^
foo.cpp: In function 'void get_Adjacent(char*, int)':
foo.cpp:14:27: error: 'strlen' was not declared in this scope
  int i,flag=0,len=strlen(t);
                           ^
foo.cpp: In function 'bool judgment(int, int)':
foo.cpp:29:242: error: 'n' was not declared in this scope
  for(i++;i<len;i++) s[i]='0'; } i=0; if(flag==1) next[i++]='1'; for(;i<len+flag;i++) next[i]=s[i-flag]; next[i]='\0'; } bool judgment(int p,int len) { int i ; if(str[p]!='1') return 0; for(i=1;i<p;i++) if(str[i]!='9') return 0; for(i=1;i+p<=n&&i<len;i++) if(str[i+p]!='0') return 0; return 1; } void getMin(char s[],char t[]) { int i,ls=strlen(s),lt=strlen(t); if(t[0]=='0'||lt>ls)
                                                                                                                                                                                                                                                  ^
foo.cpp: In function 'void getMin(char*, char*)':
foo.cpp:29:346: error: 'strlen' was not declared in this scope
  for(i++;i<len;i++) s[i]='0'; } i=0; if(flag==1) next[i++]='1'; for(;i<len+flag;i++) next[i]=s[i-flag]; next[i]='\0'; } bool judgment(int p,int len) { int i ; if(str[p]!='1') return 0; for(i=1;i<p;i++) if(str[i]!='9') return 0; for(i=1;i+p<=n&&i<len;i++) if(str[i+p]!='0') return 0; return 1; } void getMin(char s[],char t[]) { int i,ls=strlen(s),lt=strlen(t); if(t[0]=='0'||lt>ls)
                                                                                                                                                                                                                                                                                                                                                          ^
foo.cpp:29:376: error: 'lt' was not declared in this scope
  for(i++;i<len;i++) s[i]='0'; } i=0; if(flag==1) next[i++]='1'; for(;i<len+flag;i++) next[i]=s[i-flag]; next[i]='\0'; } bool judgment(int p,int len) { int i ; if(str[p]!='1') return 0; for(i=1;i<p;i++) if(str[i]!='9') return 0; for(i=1;i+p<=n&&i<len;i++) if(str[i+p]!='0') return 0; return 1; } void getMin(char s[],char t[]) { int i,ls=strlen(s),lt=strlen(t); if(t[0]=='0'||lt>ls)
                                                                                                                                                                                                                                                                                                                                                                                        ^
foo.cpp:31:5: error: 'lt' was not declared in this scope
  if(lt<ls) { strcpy(s,t); ansp=fp; return; } for(i=0;i<ls;i++) { if(s[i]>t[i])
     ^
foo.cpp:31:24: error: 'strcpy' was not declared in this scope
  if(lt<ls) { strcpy(s,t); ansp=fp; return; } for(i=0;i<ls;i++) { if(s[i]>t[i])
                        ^
foo.cpp:31:27: error: 'ansp' was not declared in this scope
  if(lt<ls) { strcpy(s,t); ansp=fp; return; } for(i=0;i<ls;i++) { if(s[i]>t[i])
                           ^
foo.cpp:31:32: error: 'fp' was not declared in this scope
  if(lt<ls) { strcpy(s,t); ansp=fp; return; } for(i=0;i<ls;i++) { if(s[i]>t[i])
                                ^
foo.cpp:34:36: error: 'strcpy' was not declared in this scope
  if(s[i]<t[i]) return; } strcpy(s,t); ansp=fp; } void find_FirstNumber() { int i,j,k,l,len,cnt; for(i=0;i<208;i++) minf[i]='A'; minf[210-1]='\0'; for(l=1;l<=n;l++) for(len=l,i=2;i<=len+1;i++) { fp=i; if(str[i]=='0') continue; if(n-i+1<len) { if(judgment(i,len+1)) { for(j=0;j<len;j++) fir[j]='9'; fir[j]='\0'; getMin(minf,fir); continue; } for(j=1;j<i&&str[j]=='9';j++); if(j==i) { for(j=0;j+i<=n;j++) temp[j]=str[i+j]; temp[j]='\0'; get_Adjacent(temp,-1); k=j; cnt=1; while(next[j-1]=='9'&&cnt<i) { k--; j--; cnt++; } for(j=0;j<k;j++) fir[j]=next[j]; for(j=1;j<i;j++) fir[k+j-1]=str[j]; fir[k+j-1]='\0'; getMin(minf,fir); continue; } for(j=1;j<i;j++) fir[len-j]=str[i-j]; fir[len]='\0'; 

信息

递交者
类型
递交
题目
P1005 超长数字串
语言
C++
递交时间
2015-08-30 13:20:48
评测时间
2015-08-30 13:21:13
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes