제출 #667691

#제출 시각아이디문제언어결과실행 시간메모리
667691ThegeekKnight16Table Tennis (info1cup20_tabletennis)C++14
20 / 100
134 ms2972 KiB
#include <bits/stdc++.h> #define int long long using namespace std; const int MAXN = 15e4 + 10; int atual[MAXN]; int v[MAXN]; int resp[MAXN]; bool FoundResp = false; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int N, K; cin >> N >> K; for (int i = 1; i <= N + K; i++) cin >> v[i]; if (K == 1) { for (int fora = 1; fora <= N + K; fora++) { int p = 1; int q = N + K; if (fora == 1) p++; if (fora == N + K) q--; int med = v[p] + v[q]; bool funciona = true; while (p < q) { if (v[p] + v[q] != med) { funciona = false; break; } p++; q--; } // cerr << fora << " " << med << '\n'; if (funciona) { for (int i = 1; i <= N + K; i++) { if (i == fora) continue; cout << v[i] << " "; } return 0; } } } else { int l = 1; int r = N; while (r <= N + K) { int p = l; int q = r; //if (fora == 1) p++; //if (fora == N + K) q--; int med = v[p] + v[q]; bool funciona = true; while (p < q) { if (v[p] + v[q] != med) { funciona = false; break; } p++; q--; } // cerr << fora << " " << med << '\n'; if (funciona) { for (int i = l; i <= r; i++) { cout << v[i] << " "; } return 0; } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...