# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
135333 | 2019-07-24T03:35:29 Z | Just_Solve_The_Problem | Bulldozer (JOI17_bulldozer) | C++11 | 2 ms | 376 KB |
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = (int)2e3 + 7; int a[N]; int x[N], y[N], w[N], pos[N]; int n; ll pref[N]; main() { scanf("%d", &n); iota(pos, pos + n, 0); for (int i = 0; i < n; i++) { scanf("%d %d %d", &x[i], &y[i], &w[i]); } sort(pos, pos + n, [&](const int &A, const int &B){ return x[A] < x[B]; }); ll mn = 0, ans = 0; for (int i = 0; i < n; i++) { if (i) pref[i] = pref[i - 1]; pref[i] += w[i]; ans += (pref[i] - mn); mn = min(mn, pref[i]); } cout << ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |