Submission #7730

#TimeUsernameProblemLanguageResultExecution timeMemory
7730gs14004공주님의 정원 (KOI11_flower)C++98
18 / 18
72 ms1864 KiB
#include <cstdio> int day(int m,int d){ return d+(m-1)*30+(m==2)-(m==3)+(m>5)+(m>7)+(m>8)+(m>10); } int main(){ int n,p,q,r,s; scanf("%d",&n); int a[n],b[n]; for (int i=0; i<n; i++) { scanf("%d %d %d %d",&p,&q,&r,&s); a[i]=day(p,q); b[i]=day(r,s); } r=0; // a[i] ~ b[i]-1. flower in int now=s=day(3,1); while (now<=day(11,30)) { for (int i=0; i<n; i++) { if(a[i]<=now && s<b[i]) s=b[i]; } if(s==now){ printf("0"); return 0; } now=s; r++; } printf("%d",r); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...