#include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
int b[n];
int t[n];
int t1=0;
int t2=0;
int f=0;
int f2=0;
for(int i=0;i<n;i++){
cin>>t[i]>>a[i]>>b[i];
}
for(int i=0;i<n;i++){
if(a[i]<=4&&b[i]>=5){
t1+=100;
}
else if(a[i]>=5&&b[i]<=4){
t2+=100;
}
}
for(int i=n-1;i>=0;i--){
for(int j=0;j<n;j++){
if(a[i]==a[j]&&i!=j&&abs(t[j]-t[i])<=10){
if(a[i]<=4){
f+=1;
}
else if(a[i]>=5){
f2+=1;
}
}
}
}
t1+=(f/2)*50;
t2+=(f2/2)*50;
cout<<t1<<" "<<t2;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Correct |
0 ms |
204 KB |
Output is correct |
8 |
Correct |
0 ms |
204 KB |
Output is correct |
9 |
Correct |
0 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |