# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
718290 | 2023-04-03T19:43:28 Z | haxorman | Table Tennis (info1cup20_tabletennis) | C++14 | 358 ms | 80404 KB |
#include <bits/stdc++.h> using namespace std; #define int long long const int mxN = 2e5 + 7; int arr[mxN]; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, k; cin >> n >> k; map<int,bool> in; for (int i = 0; i < n + k; ++i) { cin >> arr[i]; in[arr[i]] = true; } map<int,int> freq; for (int i = 0; i < k + 2; ++i) { for (int j = n + k - 1; j >= n - 1; --j) { int sum = arr[i] + arr[j]; freq[sum]++; } } for (auto p : freq) { if (p.second >= k - 1) { int sum = p.first; vector<int> nums; for (int l = 0; l < n + k; ++l) { if (sum - arr[l] >= 0 && in[sum - arr[l]]) { nums.push_back(arr[l]); } } if (nums.size() >= n) { for (int l = 0; l < n; ++l) { cout << nums[l] << ' '; } cout << "\n"; exit(0); } } } assert(false); } // 1 2 1 2 3
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 852 KB | Output is correct |
2 | Correct | 1 ms | 468 KB | Output is correct |
3 | Correct | 1 ms | 504 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 2328 KB | Output is correct |
2 | Correct | 158 ms | 41812 KB | Output is correct |
3 | Correct | 77 ms | 13664 KB | Output is correct |
4 | Correct | 78 ms | 13660 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 139 ms | 36088 KB | Output is correct |
2 | Correct | 74 ms | 13672 KB | Output is correct |
3 | Correct | 358 ms | 80404 KB | Output is correct |
4 | Correct | 82 ms | 13684 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 4 ms | 1492 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 468 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 468 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 468 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 49 ms | 12112 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |