제출 #690924

#제출 시각아이디문제언어결과실행 시간메모리
690924vladiliusTable Tennis (info1cup20_tabletennis)C++17
35 / 100
3082 ms4256 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; bool check(vector<ll> a){ int n = a.size(); ll k = a[0] + a.back(); for (int i = 1; i < n - i - 1; i++){ if (a[i] + a[n - i - 1] != k){ return false; } } return true; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, k; cin>>n>>k; vector<ll> a(n + k); for (int i = 0; i < n + k; i++){ cin>>a[i]; } if (n <= 100 && k <= 100){ for (int i = 0; i < k; i++){ vector<ll> b; for (int j = 0; j < n; j++){ b.push_back(a[i + j]); } if (check(b)){ for (int j: b){ cout<<j<<" "; } return 0; } } } else { for (int i = 0; i < n + k; i++){ vector<ll> b = a; b.erase(b.begin() + i); if (check(b)){ for (int j = 0; j < n; j++){ cout<<b[j]<<" "; } 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...