# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
447901 | 2021-07-28T05:14:47 Z | blue | Road Construction (JOI21_road_construction) | C++17 | 2323 ms | 2097156 KB |
#include <iostream> #include <algorithm> using namespace std; long long abs_diff(long long a, long long b) { return max(a-b, b-a); } int main() { int N, K; cin >> N >> K; long long X[N], Y[N]; for(int i = 0; i < N; i++) cin >> X[i] >> Y[i]; vector<long long> res; for(int i = 0; i < N; i++) for(int j = i+1; j < N; j++) res.push_back(abs_diff(X[i], X[j]) + abs_diff(Y[i], Y[j])); sort(res.begin(), res.end()); while(res.size() > K) res.pop_back(); for(long long r:res) cout << r << ' '; cout << '\n'; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 81 ms | 6896 KB | Output is correct |
2 | Correct | 87 ms | 6888 KB | Output is correct |
3 | Correct | 60 ms | 5200 KB | Output is correct |
4 | Correct | 55 ms | 4944 KB | Output is correct |
5 | Correct | 76 ms | 5752 KB | Output is correct |
6 | Correct | 26 ms | 4436 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2323 ms | 2097156 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2153 ms | 2097156 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2153 ms | 2097156 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 81 ms | 6896 KB | Output is correct |
2 | Correct | 87 ms | 6888 KB | Output is correct |
3 | Correct | 60 ms | 5200 KB | Output is correct |
4 | Correct | 55 ms | 4944 KB | Output is correct |
5 | Correct | 76 ms | 5752 KB | Output is correct |
6 | Correct | 26 ms | 4436 KB | Output is correct |
7 | Runtime error | 1915 ms | 2097156 KB | Execution killed with signal 9 |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 81 ms | 6896 KB | Output is correct |
2 | Correct | 87 ms | 6888 KB | Output is correct |
3 | Correct | 60 ms | 5200 KB | Output is correct |
4 | Correct | 55 ms | 4944 KB | Output is correct |
5 | Correct | 76 ms | 5752 KB | Output is correct |
6 | Correct | 26 ms | 4436 KB | Output is correct |
7 | Runtime error | 2323 ms | 2097156 KB | Execution killed with signal 9 |
8 | Halted | 0 ms | 0 KB | - |