0_0_20611888_5799.cpp:4:5: error: 'kk' does not name a type
kk+mid) continue; mark_dfs[date]=1; if(mark_gx[date]==-1||dfs(mark_gx[date])) { mark_gx[date]=x; return 1; } } return 0;}int finish(){ memset(mark_gx,255,sizeof(mark_gx)); for(int i=1;i<=n;i++) { memset(mark_dfs,0,sizeof(mark_dfs)); if(!dfs(i)) return 0; } return 1;}int main(){ int T; scanf("%d",&T); while(T--) { scanf("%d",&n); tot=1; min=INF; max=-INF; memset(list,0,sizeof(list)); for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) { scanf("%d",&map[i][j]); if(min>map[i][j]) min=map[i][j]; if(max<map[i][j]) max=map[i][j]; add(i,j,map[i][j]); } right=max-min; left=0; while(left<=right) { if(left==right) break; mid=(left+right-1)/2; int flag=0; for(kk=min;kk+mid<=max;kk++) { if(finish()) {flag=1;break;} } if(flag) {right=mid;} if(!flag) {left=mid+1;} } printf("%d\n",right); } }
^
0_0_20611888_5799.cpp:4:28: error: 'mark_dfs' does not name a type
kk+mid) continue; mark_dfs[date]=1; if(mark_gx[date]==-1||dfs(mark_gx[date])) { mark_gx[date]=x; return 1; } } return 0;}int finish(){ memset(mark_gx,255,sizeof(mark_gx)); for(int i=1;i<=n;i++) { memset(mark_dfs,0,sizeof(mark_dfs)); if(!dfs(i)) return 0; } return 1;}int main(){ int T; scanf("%d",&T); while(T--) { scanf("%d",&n); tot=1; min=INF; max=-INF; memset(list,0,sizeof(list)); for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) { scanf("%d",&map[i][j]); if(min>map[i][j]) min=map[i][j]; if(max<map[i][j]) max=map[i][j]; add(i,j,map[i][j]); } right=max-min; left=0; while(left<=right) { if(left==right) break; mid=(left+right-1)/2; int flag=0; for(kk=min;kk+mid<=max;kk++) { if(finish()) {flag=1;break;} } if(flag) {right=mid;} if(!flag) {left=mid+1;} } printf("%d\n",right); } }
^
0_0_20611888_5799.cpp:4:51: error: expected unqualified-id before 'if'
kk+mid) continue; mark_dfs[date]=1; if(mark_gx[date]==-1||dfs(mark_gx[date])) { mark_gx[date]=x; return 1; } } return 0;}int finish(){ memset(mark_gx,255,sizeof(mark_gx)); for(int i=1;i<=n;i++) { memset(mark_dfs,0,sizeof(mark_dfs)); if(!dfs(i)) return 0; } return 1;}int main(){ int T; scanf("%d",&T); while(T--) { scanf("%d",&n); tot=1; min=INF; max=-INF; memset(list,0,sizeof(list)); for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) { scanf("%d",&map[i][j]); if(min>map[i][j]) min=map[i][j]; if(max<map[i][j]) max=map[i][j]; add(i,j,map[i][j]); } right=max-min; left=0; while(left<=right) { if(left==right) break; mid=(left+right-1)/2; int flag=0; for(kk=min;kk+mid<=max;kk++) { if(finish()) {flag=1;break;} } if(flag) {right=mid;} if(!flag) {left=mid+1;} } printf("%d\n",right); } }
^
0_0_20611888_5799.cpp:4:170: error: expected declaration before '}' token
kk+mid) continue; mark_dfs[date]=1; if(mark_gx[date]==-1||dfs(mark_gx[date])) { mark_gx[date]=x; return 1; } } return 0;}int finish(){ memset(mark_gx,255,sizeof(mark_gx)); for(int i=1;i<=n;i++) { memset(mark_dfs,0,sizeof(mark_dfs)); if(!dfs(i)) return 0; } return 1;}int main(){ int T; scanf("%d",&T); while(T--) { scanf("%d",&n); tot=1; min=INF; max=-INF; memset(list,0,sizeof(list)); for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) { scanf("%d",&map[i][j]); if(min>map[i][j]) min=map[i][j]; if(max<map[i][j]) max=map[i][j]; add(i,j,map[i][j]); } right=max-min; left=0; while(left<=right) { if(left==right) break; mid=(left+right-1)/2; int flag=0; for(kk=min;kk+mid<=max;kk++) { if(finish()) {flag=1;break;} } if(flag) {right=mid;} if(!flag) {left=mid+1;} } printf("%d\n",right); } }
^
|