Submission #14338

#TimeUsernameProblemLanguageResultExecution timeMemory
14338kyungjun2공주님의 정원 (KOI11_flower)C11
13.87 / 18
74 ms1864 KiB
#include<stdio.h> int n,i,arr[100000][2],fmax,smax,sum; int main(){ scanf("%d",&n); for(i=0;i<n;i++){ int t[4]; scanf("%d %d %d %d",&t[0],&t[1],&t[2],&t[3]); arr[i][0]=t[0]*100+t[1]; arr[i][1]=t[2]*100+t[3]; } fmax=301; while(1){ int t; t=fmax; for(i=n-1;i>=0;i--){ if(arr[i][0]<=t){ if(arr[i][1]>=fmax){ fmax=arr[i][1]; } } } if(smax!=fmax) sum++; else{ goto s; } if(sum>n||fmax==t){ goto s; } if(smax>=1130||fmax>=1130){ break; } for(i=n-1;i>=0;i--){ if(arr[i][0]<=fmax){ if(arr[i][1]>=smax){ smax=arr[i][1]; } } } if(smax!=fmax) sum++; else{ goto s; } if(sum>n||smax==t){ s: printf("0"); return 0; } if(smax>=1130||fmax>=1130){ break; } fmax=smax; } if(fmax>smax){ if(fmax<=1130) goto s; } else if(smax<=1130) goto s; printf("%d",sum); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...