Submission #872925

#TimeUsernameProblemLanguageResultExecution timeMemory
872925vjudge1Best Place (NOI17_bestplace)C++14
0 / 100
67 ms348 KiB
#include <iostream> #include <algorithm> using namespace std; int main(){ int N = 0; cin >> N; int X_max,Y_max = 0; int X_min,Y_min = 0; for(int i = 0; i < N; i++){ int first = 0; int second = 0; cin >> first; cin >> second; if(i == 0){ X_max, X_min = first; Y_max, Y_min = second; }else{ X_min = min(X_min, first); Y_min = min(Y_min, second); X_max = max(X_max, first); Y_max = max(Y_max, second); } } int x = X_max + X_min; int y = Y_max + Y_min; cout << x/2 << " " << y/2; }

Compilation message (stderr)

bestplace.cpp: In function 'int main()':
bestplace.cpp:17:13: warning: left operand of comma operator has no effect [-Wunused-value]
   17 |             X_max, X_min = first;
      |             ^~~~~
bestplace.cpp:18:13: warning: left operand of comma operator has no effect [-Wunused-value]
   18 |             Y_max, Y_min = second;
      |             ^~~~~
bestplace.cpp:26:9: warning: 'X_min' may be used uninitialized in this function [-Wmaybe-uninitialized]
   26 |     int x = X_max + X_min;
      |         ^
bestplace.cpp:26:9: warning: 'X_max' may be used uninitialized in this function [-Wmaybe-uninitialized]
#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...