# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
369155 | 2021-02-20T15:31:51 Z | doowey | Table Tennis (info1cup20_tabletennis) | C++14 | 3000 ms | 17360 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); int main(){ fastIO; int n, k; cin >> n >> k; int m = (n + k); vector<int> q(m); for(int i = 0; i < m ; i ++) cin >> q[i]; sort(q.begin(), q.end()); int pari = 0; int rem = n/2; vector<int> soln; int ci, cj; int pi, pj; bool brok; for(int i = 0 ; i < m ; i ++ ){ for(int j = 1; j <= k + 1; j ++ ){ if(i + j < m){ if(i + 1 >= n/2 && m-(i+j) >= n/2){ rem = n/2-1; pi = i; pj = i+j; soln.push_back(i); soln.push_back(i + j); ci = i-1; cj = j+1; while(rem > 0){ if(ci < 0 || cj >= m) break; if(q[pi]+q[pj] == q[ci]+q[cj]){ soln.push_back(ci); soln.push_back(cj); pi = ci; pj = cj; ci -- ; cj ++ ; rem -- ; } else{ if(q[ci]+q[cj] > q[pi]+q[pj]){ ci--; } else{ cj++; } } } if(rem == 0){ sort(soln.begin(), soln.end()); for(auto x : soln) cout << q[x] << " "; cout << "\n"; return 0; } } } } } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output not subsequence of input |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 1384 KB | Output not subsequence of input |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 71 ms | 5368 KB | Output not subsequence of input |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Incorrect | 10 ms | 1136 KB | Output not subsequence of input |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Incorrect | 32 ms | 3304 KB | Output not subsequence of input |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 364 KB | Output is correct |
2 | Incorrect | 433 ms | 17360 KB | Output not subsequence of input |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Execution timed out | 3074 ms | 3320 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |