# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
890023 | TAhmed33 | Team Contest (JOI22_team) | C++98 | 337 ms | 852 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;
using matr = array <int, 3>;
matr a[4001];
matr b[4001];
int n;
int mx = -1;
void solve () {
sort(b + 1, b + n + 1);
int ptr = 0;
for (int i = 1; i <= n; i++) { //i is larger than anything <= ptr in a
while (ptr + 1 < i && b[ptr + 1][0] < b[i][0]) ptr++;
if (ptr != 0) sort(b + 1, b + ptr + 1, [] (matr &x, matr &y) {
return x[1] < y[1];
});
int mx2 = 0, ptr2 = 0;
for (int j = 1; j <= ptr; j++) {
if (b[j][1] <= b[i][1]) continue;
while (ptr2 + 1 < j && b[ptr2 + 1][1] < b[j][1]) {
ptr2++; mx2 = max(mx2, b[ptr2][2]);
}
if (mx2 > max(b[j][2], b[i][2])) {
mx = max(mx, mx2 + b[j][1] + b[i][0]);
}
}
}
}
int main () {
cin >> n;
for (int i = 1; i <= n; i++) for (int j = 0; j < 3; j++) cin >> a[i][j], b[i][j] = a[i][j];
# | 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... |