Submission #1059931

#TimeUsernameProblemLanguageResultExecution timeMemory
1059931kachim2Cloud Computing (CEOI18_clo)C++17
0 / 100
1 ms440 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<array<int, 3>> comp(n); for(int i = 0; i < n; i++){ cin >> comp[i][1] >> comp[i][2] >> comp[i][0]; } std::sort(comp.begin(), comp.end()); int m; cin >> m; vector<array<int, 3>> ord(m); for(int i = 0; i < m; i++){ cin >> ord[i][1] >> ord[i][2] >> ord[i][0]; } std::sort(ord.rbegin(), ord.rend()); int profit = 0; for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ if(comp[i][2] >= ord[j][2]){ profit+=max(0, ord[j][0]-comp[i][0]); ord[j][2]=INT_MAX; } } } cout << profit << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...