Submission #667636

#TimeUsernameProblemLanguageResultExecution timeMemory
667636LFFBTable Tennis (info1cup20_tabletennis)C++14
0 / 100
32 ms2336 KiB
#include <iostream> #include <algorithm> #define debug(args...) //printf(args) const int MAX_M = 16e4; typedef long long llong; int n, m, k; int input[MAX_M]; llong sum; int main() { scanf("%d %d", &n, &k); if (k != 1) return 1; m = n + k; for (int i = 0; i < m; i++) { scanf("%d", &input[i]); sum += input[i]; } int bad = -1; for (int i = 0; i < m; i++) { sum -= input[i]; if (sum % (n / 2) == 0) { debug("%d is bad\n", i); bad = input[i]; } sum += input[i]; } std::sort(input, input+m); for (int i = 0; i < m; i++) { if (input[i] == bad) continue; printf("%d ", input[i]); } printf("\n"); }

Compilation message (stderr)

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