Submission #548057

#TimeUsernameProblemLanguageResultExecution timeMemory
548057aryan12Ljeto (COCI21_ljeto)C++17
50 / 50
1 ms328 KiB
#include <bits/stdc++.h> using namespace std; #define int long long mt19937_64 RNG(chrono::steady_clock::now().time_since_epoch().count()); void Solve() { int n; cin >> n; vector<array<int, 3> > a(n); for(int i = 0; i < n; i++) { cin >> a[i][0] >> a[i][1] >> a[i][2]; } vector<int> ok(8, -11); sort(a.begin(), a.end()); int points_a = 0, points_b = 0; for(int i = 0; i < n; i++) { if(a[i][1] <= 4) { points_a += 100; if(ok[a[i][1]] + 10 >= a[i][0]) { points_a += 50; } ok[a[i][1]] = a[i][0]; } else { points_b += 100; if(ok[a[i][1]] + 10 >= a[i][0]) { points_b += 50; } ok[a[i][1]] = a[i][0]; } } cout << points_a << " " << points_b << "\n"; } int32_t main() { auto begin = std::chrono::high_resolution_clock::now(); ios_base::sync_with_stdio(0); cin.tie(0); int t = 1; //cin >> t; for(int i = 1; i <= t; i++) { //cout << "Case #" << i << ": "; Solve(); } auto end = std::chrono::high_resolution_clock::now(); auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin); cerr << "Time measured: " << elapsed.count() * 1e-9 << " seconds.\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...