# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
674162 | 2022-12-23T10:55:32 Z | Tangirkul | Ljeto (COCI21_ljeto) | C++17 | 1 ms | 316 KB |
#include<bits/stdc++.h> #define ll long long #define fi first #define se second #define pb push_back #define sz size #define Junanna ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; const ll K = 32; const ll INF = 1e9 + 7; const ll MOD = 1e9 + 7; const ll N = (1e5 + 125); void ma1n () { ll n; cin >> n; pair <ll, pair <ll, ll>> s[n + 7]; ll last[10]; for (ll i = 1; i <= 10; i++) { last[i] = 0; } for (ll i = 1; i <= n; i++) { cin >> s[i].fi >> s[i].se.fi >> s[i].se.se; } sort (s + 1, s + n + 1); ll b = 0, r = 0; for (ll i = 1; i <= n; i++) { if (last[s[i].se.fi] == 0) { if (s[i].se.fi <= 4) { b += 100; } else { r += 100; } last[s[i].se.fi] = s[i].fi; } else if (s[i].fi - last[s[i].se.fi] <= 10) { if (s[i].se.fi <= 4) { b += 150; } else { r += 150; } last[s[i].se.fi] = s[i].fi; } else { if (s[i].se.fi <= 4) { b += 100; } else { r += 100; } last[s[i].se.fi] = s[i].fi; } } cout << b << " " << r; } int main () { Junanna; ll t = 1; while (t--) { ma1n (); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 316 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 1 ms | 212 KB | Output is correct |
6 | Correct | 1 ms | 212 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 316 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 1 ms | 212 KB | Output is correct |
8 | Correct | 1 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 212 KB | Output is correct |
10 | Correct | 1 ms | 212 KB | Output is correct |
11 | Correct | 1 ms | 212 KB | Output is correct |
12 | Correct | 1 ms | 212 KB | Output is correct |
13 | Correct | 1 ms | 212 KB | Output is correct |