# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
73124 | win11905 | Cloud Computing (CEOI18_clo) | C++11 | 504 ms | 1612 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 iii tuple<int, int, int>
#define long long long
const int N = 2005;
int n, m;
long dp[N * 50];
vector<iii> A, B;
int main() {
scanf("%d", &n);
for(int i = 0, a, b, c; i < n; ++i) {
scanf("%d %d %d", &a, &b, &c);
A.emplace_back(a, b, c);
}
scanf("%d", &m);
for(int i = 0, a, b, c; i < m; ++i) {
scanf("%d %d %d", &a, &b, &c);
B.emplace_back(a, b, c);
}
fill_n(dp, N*50, (long)(-1e18));
dp[0] = 0;
sort(A.begin(), A.end(), [&](const iii &a, const iii &b) { return get<1>(a) > get<1>(b); });
sort(B.begin(), B.end(), [&](const iii &a, const iii &b) { return get<1>(a) > get<1>(b); });
int ptr = 0;
for(int i = 0; i < m; ++i) {
while(ptr != n && get<1>(A[ptr]) >= get<1>(B[i])) {
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |