# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
275994 | 2020-08-20T09:00:32 Z | 송준혁(#5101) | Radio (Balkan15_RADIO) | C++17 | 70 ms | 2548 KB |
#include <bits/stdc++.h> #define pb push_back using namespace std; typedef long long LL; typedef pair<int,int> pii; int N; LL L=-12345678901ll, S, P, ans=(1ll<<60), a, b; vector<LL> V; int main(){ scanf("%d %*d", &N); for (int i=1; i<=N; i++){ scanf("%lld %lld %*d", &a, &b); S--, P += a-b-L; V.pb(a-b); V.pb(a+b); } sort(V.begin(), V.end()); for (LL t : V){ P += S*(t - L), S++; ans = min(ans, P), L=t; } printf("%lld\n", ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 1 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 1 ms | 384 KB | Output is correct |
6 | Correct | 4 ms | 512 KB | Output is correct |
7 | Correct | 12 ms | 1020 KB | Output is correct |
8 | Correct | 28 ms | 1520 KB | Output is correct |
9 | Correct | 57 ms | 2540 KB | Output is correct |
10 | Correct | 47 ms | 2548 KB | Output is correct |
11 | Correct | 70 ms | 2540 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |