Submission #667605

#TimeUsernameProblemLanguageResultExecution timeMemory
667605ericTable Tennis (info1cup20_tabletennis)C++14
11 / 100
27 ms2280 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; float comp; if(i == 0)comp = v[1] + v[n + k - 1]; else if(i == n + k - 1)comp = v[0] + v[n + k - 2]; else comp = v[0] + v[n + k - 1]; //printf("%f %f\n", m, comp); if(m == comp){ wrong = v[i]; break; } } //sort(v, v + (n + k)); for(int i = 0; i < n + k; i++){ if(v[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:28:9: warning: 'wrong' may be used uninitialized in this function [-Wmaybe-uninitialized]
   28 |         if(v[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...