using namespace std;
#include <bits/stdc++.h>
int main(){
int N;
cin>>N;
int T[N+1];
int A[N+1];
int B[N+1];
for(int i=1;i<=N;i++){
cin>>T[i]>>A[i]>>B[i];
}
int poinA=0;
int poinB=0;
int lastTime[9];
fill(lastTime,lastTime+9,0);
for(int i=1;i<=N;i++){
if(A[i]<=4){
poinA+=100;
if(lastTime[A[i]]!=0&&T[i]-lastTime[A[i]]<=10){
poinA+=50;
}
lastTime[A[i]]=T[i];
}else{
poinB+=100;
if(lastTime[A[i]]!=0&&T[i]-lastTime[A[i]]<=10){
poinB+=50;
}
lastTime[A[i]]=T[i];
}
}
cout<<poinA<<" "<<poinB<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |