This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ss second
#define ff first
int main() {
int n ; cin >> n ; int fi = 0 , se = 0 ;
pair <int , int> a[n+4] ;
for (int i = 1;i <= n;i ++ ) {
cin >> a[i].ss >> a[i].ff ;
int x ; cin >> x ;
}
sort ( a + 1 , a + n + 1 ) ;
if ( a[1].ff > 4 ) se += 100 ;
else fi += 100 ;
for (int i = 2 ; i <= n; i++ ) {
if ( a[i].ff <= 4 ) {
if ( a[i].ff == a[i-1].ff ) {
if ( a[i].ss - a[i-1].ss <= 10 ) fi += 150 ;
else fi += 100 ;
}
else fi += 100 ;
}
else {
if ( a[i].ff == a[i-1].ff ) {
if ( a[i].ss - a[i-1].ss <= 10 ) se += 150 ;
else se += 100 ;
}
else se += 100 ;
}
}
cout << fi << ' ' << se ;
return 0 ;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |