#include<stdio.h>
int N;
int date[14]={0,31,59,90,120,151,181,212,243,273,304,334,};
int T[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<N;i++){
scanf("%d %d %d %d",&a,&b,&c,&d);
if(T[df(a,b)]<df(c,d))T[df(a,b)]=df(c,d);
}
return 0;
}
int solve(){
int mi=0;
int max=0;
for(int i=0;i<df(3,1);i++){
if(T[i]>max){mi=i,max=T[i];}
}
int ni=0,nmax=0;
while(nmax<df(11,30)){
for(int i=mi;i<=max;i++){
if(T[i]>nmax){ni=i,nmax=T[i];}
}
ans++;
mi=ni;
max=nmax;
}
return 0;
}
int output(){
if(ans==0) puts("0");
else
printf("%d",ans+1);
return 0;
}
int main(){
input();
solve();
output();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1000 ms |
1084 KB |
Program timed out |
2 |
Correct |
0 ms |
1088 KB |
Output is correct |
3 |
Correct |
0 ms |
1088 KB |
Output is correct |
4 |
Correct |
0 ms |
1088 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
4 |
Correct |
0 ms |
1088 KB |
Output is correct |
5 |
Correct |
0 ms |
1088 KB |
Output is correct |
6 |
Correct |
4 ms |
1088 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
1088 KB |
Output is correct |
2 |
Correct |
4 ms |
1088 KB |
Output is correct |
3 |
Correct |
12 ms |
1088 KB |
Output is correct |
4 |
Correct |
12 ms |
1088 KB |
Output is correct |
5 |
Correct |
20 ms |
1088 KB |
Output is correct |
6 |
Incorrect |
24 ms |
1088 KB |
Output isn't correct |
7 |
Correct |
28 ms |
1088 KB |
Output is correct |
8 |
Correct |
36 ms |
1088 KB |
Output is correct |
9 |
Execution timed out |
1000 ms |
1084 KB |
Program timed out |
10 |
Correct |
32 ms |
1088 KB |
Output is correct |