Submission #8004

# Submission time Handle Problem Language Result Execution time Memory
8004 2014-08-27T05:41:36 Z lingxiang 공주님의 정원 (KOI11_flower) C++
0 / 18
36 ms 1084 KB
#include<stdio.h>
  
int N;
int date[14]={0,31,59,90,120,151,181,212,243,273,304,334,};
int T[400], D[400];
int df(int x,int y){return date[x-1]+y;}
int ans;
  
int input(){
    scanf("%d",&N);
    int a,b,c,d;
    for(int i=0;i<400;i++)T[i] = 1000;
    for(int i=0;i<N;i++){
        scanf("%d %d %d %d",&a,&b,&c,&d);
        if(T[df(c,d)]>df(a,b))T[df(c,d)]=df(a,b);
    }
    return 0;
}
  
int solve(){
    for(int i=0;i<400;i++)D[i] = 1000;
    for(int i=df(3,1);i<=df(11,30);++i)for(int j=T[i]-1;j>i;j++)if(D[j] < D[i] + 1)D[j] = D[i] + 1;
    ans = (D[df(11,30)] == 1000 ? 0 : D[df(11,30)]);
    return 0;
}
  
int output(){
    printf("%d",ans);
    return 0;
}

int main(){
    input();
    solve();
    output();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 1084 KB SIGSEGV Segmentation fault
2 Runtime error 0 ms 1084 KB SIGSEGV Segmentation fault
3 Runtime error 0 ms 1084 KB SIGSEGV Segmentation fault
4 Runtime error 0 ms 1084 KB SIGSEGV Segmentation fault
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 1084 KB SIGSEGV Segmentation fault
2 Runtime error 0 ms 1084 KB SIGSEGV Segmentation fault
3 Runtime error 0 ms 1084 KB SIGSEGV Segmentation fault
4 Runtime error 0 ms 1084 KB SIGSEGV Segmentation fault
5 Runtime error 0 ms 1084 KB SIGSEGV Segmentation fault
6 Runtime error 4 ms 1084 KB SIGSEGV Segmentation fault
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 1084 KB SIGSEGV Segmentation fault
2 Runtime error 4 ms 1084 KB SIGSEGV Segmentation fault
3 Runtime error 12 ms 1084 KB SIGSEGV Segmentation fault
4 Runtime error 16 ms 1084 KB SIGSEGV Segmentation fault
5 Runtime error 20 ms 1084 KB SIGSEGV Segmentation fault
6 Runtime error 20 ms 1084 KB SIGSEGV Segmentation fault
7 Runtime error 28 ms 1084 KB SIGSEGV Segmentation fault
8 Runtime error 28 ms 1084 KB SIGSEGV Segmentation fault
9 Runtime error 32 ms 1084 KB SIGSEGV Segmentation fault
10 Runtime error 36 ms 1084 KB SIGSEGV Segmentation fault