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;
using ll = long long;
using vi = vector<ll>;
using pl = pair<ll,ll>;
#define pb push_back
#define form(m,it) for(auto it=m.begin(); it!=m.end(); it++)
#define forp(i,a,b) for(ll i=a; i<=b; i++)
#define forn(i,a,b) for(ll i=a; i>=b; i--)
#define newl '\n'
#define ff first
#define ss second
const ll mod = 1e9 + 7;
void solve(){
ll n; cin>>n;
vi adj[9];
ll t,a,b;
forp(i,1,n){
cin>>t>>a>>b;
adj[a].pb(t);
}
forp(i,1,8){
sort(adj[i].begin(), adj[i].end());
}
ll prev;
ll cnt[2]={0};
forp(i,1,8){
prev=-100;
for(auto u:adj[i]){
if(u-prev<=10){
cnt[(i-1)/4]+=50;
}
cnt[(i-1)/4]+=100;
prev=u;
}
}
cout<<cnt[0]<<" "<<cnt[1]<<newl;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t=1; //cin>>t;
while(t--)solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |