# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
736757 | 2023-05-06T07:58:28 Z | stevancv | Table Tennis (info1cup20_tabletennis) | C++14 | 3000 ms | 5212 KB |
#include <bits/stdc++.h> #define ll long long #define ld long double #define sp ' ' #define en '\n' #define smin(a, b) a = min(a, b) #define smax(a, b) a = max(a, b) using namespace std; const int N = 2e5 + 2; const ll linf = 1e18; int a[N], n, k; void Resi(int x) { vector<int> v; int p = n + k - 1; for (int i = 0; i < n + k - 1; i++) { while (i < p && a[i] + a[p] > x) p -= 1; if (i < p && a[i] + a[p] == x) { v.push_back(a[i]); v.push_back(a[p]); p -= 1; } } if (v.size() >= n) { vector<int> ans; for (int i = 0; i < n; i++) ans.push_back(v[i]); sort(ans.begin(), ans.end()); for (int i : ans) cout << i << sp; cout << en; exit(0); } } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n >> k; for (int i = 0; i < n + k; i++) cin >> a[i]; if (n <= k) for (int i = 0; i < n + k; i++) for (int j = i + 1; j < n + k; j++) Resi(a[i] + a[j]); mt19937 mt(time(nullptr)); while (1) { int x = mt() % (n + k); int mn = max(0, x - k); int mx = min(n - 1, x); int l = n + k - mx - 1; int r = n + k - mn - 1 + k; for (int i = l; i <= r; i++) if (i != x) Resi(a[i] + a[x]); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Execution timed out | 3062 ms | 340 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 980 KB | Output is correct |
2 | Correct | 36 ms | 5212 KB | Output is correct |
3 | Execution timed out | 3056 ms | 2312 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 43 ms | 5040 KB | Output is correct |
2 | Execution timed out | 3065 ms | 2380 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 8 ms | 332 KB | Output is correct |
3 | Correct | 1 ms | 328 KB | Output is correct |
4 | Correct | 5 ms | 212 KB | Output is correct |
5 | Correct | 1 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3064 ms | 212 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 2 ms | 340 KB | Output is correct |
3 | Execution timed out | 3053 ms | 356 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 49 ms | 5200 KB | Output is correct |
3 | Execution timed out | 3053 ms | 2356 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Correct | 325 ms | 5176 KB | Output is correct |
3 | Execution timed out | 3052 ms | 2268 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |