# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
711293 | kostia244 | Team Contest (JOI22_team) | C++17 | 2067 ms | 3532 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>
#define all(x) begin(x), end(x)
using namespace std;
using ll = long long;
int main() {
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
vector<array<int, 3>> a(n);
for(auto &[x, y, z] : a)
cin >> x >> y >> z;
sort(all(a));
a.erase(unique(all(a)), a.end());
n = a.size();
ll ans = -1;
for(int i = 0; i < n; i++) {//z
ll ymax = -1, upd = -1;
for(int j = 0; j < n; j++) if(a[j][2] < a[i][2] && (a[j][0] > a[i][0] || a[j][1] > a[i][1])) {//x
if(ymax >= a[j][1]) {
if(ymax > max(a[j][1], a[i][1]) && a[j][0] > a[i][0] && upd != a[j][0]) {
// if(a[i][2] + ymax + a[j][0] == 14) {
// cout << a[i][0] << " " << a[i][1] << " " << a[i][2] << endl;
// cout << a[j][0] << " " << a[j][1] << " " << a[j][2] << endl;
// cout << ymax << endl << endl;
// }
ans = max(ans, a[i][2] + ymax + a[j][0]);
}
} else
ymax = a[j][1], upd = a[j][0];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |