Submission #991585

#TimeUsernameProblemLanguageResultExecution timeMemory
991585qrnLjeto (COCI21_ljeto)C++14
25 / 50
1 ms604 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define ep emplace_back #define ins insert #define fi first #define er erase #define se second template<class IStr, class T> IStr& operator>>(IStr& is, vector<T>& v) { for (auto& x : v) is >> x; } #define give(v) \ cout << v << endl; \ return; #define print(a) \ for (auto v : a) \ { \ cout << v << " "; \ } \ cout << endl; #define vs vector<string> #define vi vector<int> #define vb vector<bool> #define pii pair<int, int> #define vvi vector<vector<int>> #define sz(x) x.size() #define vpii vector<pair<int, int>> #define SPEED \ ios_base::sync_with_stdio(0); \ cin.tie(NULL); \ cout.tie(NULL); #define ALL(x) x.begin(), x.end() #define endl "\n" #define yes cout << "YES" << endl #define no cout << "NO" << endl #define out cout << endl #define impos cout << -1 << endl #define int long long const long double pi = 2 * acosl(0); const int inf = 1e9 + 7; const int mod = inf; const int szz = 3e5 + 5; struct spray{ int t; int a; int b; }; void solve(){ int events; cin >> events; vector<pair<int,pii>>v; // time, shooter, killed for(int round = 0; round < events; round++){ spray rr; cin >> rr.t >> rr.a >> rr.b; v.pb({rr.t, {rr.a, rr.b}}); } sort(ALL(v)); int sol = 0, sag = 0; for(int i = 0; i < events; i++){ if(v[i].se.fi <= 4){ sol += 100; if(i != 0){ if(v[i].fi - v[i-1].fi <= 10 && v[i-1].se.fi == v[i].se.fi){ sol += 50; } } } else { sag += 100; if(i != 0){ if(v[i].fi - v[i-1].fi <= 10 && v[i].se.fi == v[i-1].se.fi){ sag += 50; } } } } cout << sol << " " << sag << endl; } signed main(){ SPEED; int tst = 1; // cin >> tst; for(int cs = 1; cs <= tst; cs++){ solve(); } // cerr << "\nTime Elapsed: " << (long double)clock() << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...