Submission #667672

#TimeUsernameProblemLanguageResultExecution timeMemory
667672hyakupTable Tennis (info1cup20_tabletennis)C++17
0 / 100
77 ms852 KiB
#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 + k; i++ ) scanf("%d", &v[i] ); for( int i = 1; i <= n + k; 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 + k; j++){ if( j == i ) continue; printf("%d ", v[j] ); } break; } } return 0; }

Compilation message (stderr)

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:15:20: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |     int n, k; scanf("%d %d", &n, &k );
      |               ~~~~~^~~~~~~~~~~~~~~~~~
tabletennis.cpp:17:44: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |     for( int i = 1; i <= n + k; i++ ) scanf("%d", &v[i] );
      |                                       ~~~~~^~~~~~~~~~~~~~
#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...