제출 #667674

#제출 시각아이디문제언어결과실행 시간메모리
667674hyakupTable Tennis (info1cup20_tabletennis)C++17
20 / 100
80 ms2332 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const int maxn = 150010; int v[maxn]; 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 + k; 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; }

컴파일 시 표준 에러 (stderr) 메시지

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