# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
667650 | Hacv16 | Table Tennis (info1cup20_tabletennis) | C++17 | 3092 ms | 5252 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX = 2e6 + 50;
const int INF = 0x3f3f3f3f;
ll n, k, ans;
vector<ll> v;
bool check(int j){
vector<ll> aux;
for(int i = 0; i < v.size(); i++){
if(i >= j && i <= j + k - 1) continue;
aux.push_back(v[i]);
}
ll sum = aux[0] + aux[aux.size() - 1];
for(int l = 1, r = aux.size() - 2; l < r; l++, r--)
if(aux[l] + aux[r] != sum) return false;
return true;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> k;
for(int i = 0; i < n + k; i++){
ll x; cin >> x;
v.push_back(x);
}
for(int i = 0; i <= v.size() - k + 1; i++)
if(check(i)){ ans = i; break;}
for(int i = 0; i < v.size(); i++){
if(i >= ans && i <= ans + k - 1) continue;
cout << v[i] << ' ';
}
cout << '\n';
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |