#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
# define ll long long
# define QR ios_base::sync_with_stdio(false); cin.tie(); cout.tie()
# define endl '\n'
# define rall(x) x.rbegin(), x.rend()
# define all(x) x.begin(), x.end()
# define ff first
# define ss second
const int maxn = (int)(1e6 + 7);
const int TAM = 200000 + 7; // 2e5
const int sz = 1000;
const int mod = 1e9 + 7;
const int INF = 1e9 + 7;
const long long INFL = 1e18 + 7;
void solve() {
ll n ;
cin >> n ; ///////// komandada 4 adaam var
vector < pair < ll , pair < ll , ll > > > a(n) ;
ll t1 = 0 , t2 = 0 ;
for(ll i = 0 ; i < n ; i++){
cin >> a[i].ff >> a[i].ss.ff >> a[i].ss.ff ;
if(i == 0){
if(a[i].ss.ff >= 5)
t2+=100;
else
t1+=100 ;
}
else{
if(a[i].ff - a[i-1].ff <= 10){
if(a[i].ss.ff == a[i-1].ss.ff){
if(a[i].ss.ff >= 5)
t2+=50 ;
else
t1+=50 ;
}
}
else{
if(a[i].ss.ff >= 5)
t2+=100 ;
else
t1+=100 ;
}
}
}
}
signed main() {
QR;
ll tt = 1;
// cin >> tt ;
while (tt--)
solve();
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... |