# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
974273 | vjudge1 | Ljeto (COCI21_ljeto) | C++17 | 1 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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[a[indeks]] = t[indeks];
} else {
if(terakhirBebek[a[indeks]] == 0){
poinBebek += 100;
terakhirBebek[a[indeks]] = t[indeks];
continue;
}
if(t[indeks]-terakhirBebek[a[indeks]] <= 10){
poinBebek += 150;
terakhirBebek[a[indeks]] = t[indeks];
} else {
poinBebek += 100;
terakhirBebek[a[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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |