# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
282573 | 2020-08-24T15:09:10 Z | AaronNaidu | Fireworks (APIO16_fireworks) | C++14 | 5 ms | 7424 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<pair<ll, ll> > graph[300001]; vector<ll> v; ll n, m, p, c, totChange, totalCost; int main() { cin >> n >> m; for (int i = 2; i < n+m+1; i++) { cin >> p >> c; v.push_back(c); } sort(v.begin(), v.end()); totalCost = 0; for (int i = 0; i < v.size(); i++) { totalCost += abs(v[i] - v[v.size()/2]); } cout << totalCost << "\n"; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 7296 KB | Output is correct |
2 | Correct | 5 ms | 7296 KB | Output is correct |
3 | Correct | 5 ms | 7424 KB | Output is correct |
4 | Correct | 5 ms | 7424 KB | Output is correct |
5 | Correct | 5 ms | 7424 KB | Output is correct |
6 | Correct | 5 ms | 7296 KB | Output is correct |
7 | Correct | 5 ms | 7424 KB | Output is correct |
8 | Correct | 5 ms | 7296 KB | Output is correct |
9 | Correct | 5 ms | 7424 KB | Output is correct |
10 | Correct | 5 ms | 7424 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 7424 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 7296 KB | Output is correct |
2 | Correct | 5 ms | 7296 KB | Output is correct |
3 | Correct | 5 ms | 7424 KB | Output is correct |
4 | Correct | 5 ms | 7424 KB | Output is correct |
5 | Correct | 5 ms | 7424 KB | Output is correct |
6 | Correct | 5 ms | 7296 KB | Output is correct |
7 | Correct | 5 ms | 7424 KB | Output is correct |
8 | Correct | 5 ms | 7296 KB | Output is correct |
9 | Correct | 5 ms | 7424 KB | Output is correct |
10 | Correct | 5 ms | 7424 KB | Output is correct |
11 | Incorrect | 5 ms | 7424 KB | Output isn't correct |
12 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 7296 KB | Output is correct |
2 | Correct | 5 ms | 7296 KB | Output is correct |
3 | Correct | 5 ms | 7424 KB | Output is correct |
4 | Correct | 5 ms | 7424 KB | Output is correct |
5 | Correct | 5 ms | 7424 KB | Output is correct |
6 | Correct | 5 ms | 7296 KB | Output is correct |
7 | Correct | 5 ms | 7424 KB | Output is correct |
8 | Correct | 5 ms | 7296 KB | Output is correct |
9 | Correct | 5 ms | 7424 KB | Output is correct |
10 | Correct | 5 ms | 7424 KB | Output is correct |
11 | Incorrect | 5 ms | 7424 KB | Output isn't correct |
12 | Halted | 0 ms | 0 KB | - |