답안 #7730

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
7730 2014-08-17T05:20:07 Z gs14004 공주님의 정원 (KOI11_flower) C++
18 / 18
72 ms 1864 KB
#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);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1204 KB Output is correct
2 Correct 0 ms 1204 KB Output is correct
3 Correct 0 ms 1204 KB Output is correct
4 Correct 0 ms 1204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1204 KB Output is correct
2 Correct 0 ms 1204 KB Output is correct
3 Correct 0 ms 1204 KB Output is correct
4 Correct 0 ms 1204 KB Output is correct
5 Correct 0 ms 1204 KB Output is correct
6 Correct 4 ms 1204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 1204 KB Output is correct
2 Correct 4 ms 1236 KB Output is correct
3 Correct 8 ms 1312 KB Output is correct
4 Correct 20 ms 1396 KB Output is correct
5 Correct 20 ms 1472 KB Output is correct
6 Correct 20 ms 1548 KB Output is correct
7 Correct 28 ms 1632 KB Output is correct
8 Correct 28 ms 1864 KB Output is correct
9 Correct 72 ms 1864 KB Output is correct
10 Correct 40 ms 1860 KB Output is correct