제출 #667668

#제출 시각아이디문제언어결과실행 시간메모리
667668hyakupTable Tennis (info1cup20_tabletennis)C++17
0 / 100
78 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; 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; }

컴파일 시 표준 에러 (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:40: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |     for( int i = 1; i <= n; 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...