Submission #667599

#TimeUsernameProblemLanguageResultExecution timeMemory
667599ericTable Tennis (info1cup20_tabletennis)C++14
0 / 100
31 ms2284 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++){ float m = ((som - v[i])*2)/n; //printf("%d\n", m); float 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]); } }

Compilation message (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...