# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
667668 | hyakup | Table Tennis (info1cup20_tabletennis) | C++17 | 78 ms | 852 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;
#define ll long long
const int maxn = 150010;
int v[maxn];
map< int, int > last, qtd;
vector<int> dists;
int main(){
int n, k; scanf("%d %d", &n, &k );
for( int i = 1; i <= n; i++ ) scanf("%d", &v[i] );
for( int i = 1; i <= n; i++ ){
int l = 1, r = n;
int soma = -1;
bool ok = true;
while( l < r ){
if( l == i ) l++;
if( r == i ) r--;
if( soma == -1 ) soma = v[l] + v[r];
else if( v[l] + v[r] != soma ){
ok = false;
break;
}
l++, r--;
}
if( ok ){
for( int j = 1; j <= n; j++){
if( j == i ) continue;
printf("%d ", v[j] );
}
break;
}
}
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... |