Submission #931

#TimeUsernameProblemLanguageResultExecution timeMemory
931tncks0121공주님의 정원 (KOI11_flower)C++98
18 / 18
157 ms1668 KiB
#include<stdio.h> #define N_ 100001 int N; int days[] = {0, 31, 59, 90,120,151,181,212,243,273,304,334,365}; int date_to_num(int m,int d){ return days[m-1] + d; } int T[366]; int D[N_+1][2]; int main(){ int i,j; scanf("%d",&N); for(i=1; i<=N; i++){ int a, b, c, d; scanf("%d%d%d%d",&a,&b,&c,&d); D[i][0] = date_to_num(a,b); D[i][1] = date_to_num(c,d); } for(i=60; i<=334; i++){ for(j=1; j<=N; j++){ if(D[j][0] <= i && i < D[j][1]){ if(T[i] > T[D[j][0]-1] + 1 || !T[i]) T[i] = T[D[j][0]-1] + 1; } } } printf("%d\n",T[334]); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...