# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1118488 | manhlinh1501 | Ljeto (COCI21_ljeto) | C++17 | 4 ms | 2832 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
const int MAXN = 1e5 + 5;
int N;
vector<pair<int, int>> adj[MAXN];
pair<int, int> ans;
signed main() {
#define task ""
if(fopen(task".inp", "r")) {
freopen(task".inp", "r", stdin);
freopen(task".out", "w", stdout);
}
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> N;
for(int i = 1; i <= N; i++) {
int t = 0, u = 0, v = 0;
cin >> t >> u >> v;
adj[u].emplace_back(t, v);
}
for(int x = 1; x <= 4; x++) {
for(int i = 0; i < (int)adj[x].size(); i++) {
for(int j = i + 1; j < (int)adj[x].size(); j++) {
if(abs(adj[x][j].first - adj[x][i].first) <= 10 and adj[x][j].second > 4) {
ans.first += 50;
break;
}
}
if(adj[x][i].second > 4) ans.first += 100;
}
}
for(int x = 5; x <= 8; x++) {
for(int i = 0; i < (int)adj[x].size(); i++) {
for(int j = i + 1; j < (int)adj[x].size(); j++) {
if(abs(adj[x][j].first - adj[x][i].first) <= 10 and adj[x][j].second < 5) {
ans.second += 50;
break;
}
}
if(adj[x][i].second < 5) ans.second += 100;
}
}
cout << ans.first << " " << ans.second << "\n";
return (0 ^ 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... |