제출 #667598

#제출 시각아이디문제언어결과실행 시간메모리
667598ericTable Tennis (info1cup20_tabletennis)C++14
0 / 100
29 ms2252 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, k, wrong; long long int som = 0; scanf("%d %d", &n, &k); int v[n + k]; for(int i = 0; i < n + k; i++){ scanf("%d", &v[i]); som += v[i]; } for(int i = 0; i < n + k; i++){ int m = ((som - v[i])*2)/n; //printf("%d\n", m); int comp = v[(i + 1)%(n + k)] + v[(i + 2)%(n + k)]; if(m == comp){ wrong = i; break; } } for(int i = 0; i < n + k; i++){ if(i == wrong)continue; printf("%d ", v[i]); } }

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

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     scanf("%d %d", &n, &k);
      |     ~~~~~^~~~~~~~~~~~~~~~~
tabletennis.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |         scanf("%d", &v[i]);
      |         ~~~~~^~~~~~~~~~~~~
tabletennis.cpp:24:9: warning: 'wrong' may be used uninitialized in this function [-Wmaybe-uninitialized]
   24 |         if(i == wrong)continue;
      |         ^~
#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...