# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
974263 | 2024-05-03T07:01:00 Z | vjudge1 | Ljeto (COCI21_ljeto) | C++17 | 1 ms | 348 KB |
#include <bits/stdc++.h> using namespace std; #define int long long int n, t[102], a[102], b[102]; int poinElang = 0, poinBebek = 0; vector <int> elang, bebek; int terakhirElang[12], terakhirBebek[12]; void solve(){ cin >> n; for(int i=1; i<=n; i++){ cin >> t[i] >> a[i] >> b[i]; if(a[i] < b[i]) elang.push_back(i); else bebek.push_back(i); } for(int i=0; i<elang.size(); i++){ int indeks = elang[i]; if(i == 0){ poinElang += 100; terakhirElang[a[indeks]] = t[indeks]; } else { if(terakhirElang[a[indeks]] == 0){ poinElang += 100; terakhirElang[a[indeks]] = t[indeks]; continue; } if(t[indeks]-terakhirElang[a[indeks]] <= 10){ poinElang += 150; terakhirElang[a[indeks]] = t[indeks]; } else { poinElang += 100; terakhirElang[a[indeks]] = t[indeks]; } } } for(int i=0; i<bebek.size(); i++){ int indeks = bebek[i]; if(i == 0){ poinBebek += 100; terakhirBebek[b[indeks]] = t[indeks]; } else { if(terakhirBebek[b[indeks]] == 0){ poinBebek += 100; terakhirBebek[b[indeks]] = t[indeks]; continue; } if(t[indeks]-terakhirBebek[b[indeks]] <= 10){ poinBebek += 150; terakhirBebek[b[indeks]] = t[indeks]; } else { poinBebek += 100; terakhirBebek[b[indeks]] = t[indeks]; } } } cout << poinElang << " " << poinBebek << endl; } int32_t main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); solve(); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 1 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Incorrect | 0 ms | 348 KB | Output isn't correct |
11 | Halted | 0 ms | 0 KB | - |