Submission #62984

#TimeUsernameProblemLanguageResultExecution timeMemory
62984sean617라멘 (JOI14_ramen)C++98
100 / 100
3 ms656 KiB
#include "ramen.h" #include <vector> using namespace std; void Ramen(int N) { int i, mxi, mni; vector<int> mx, mn; mx.clear(), mn.clear(); for (i = 0; i < N - 1; i += 2) { if (Compare(i, i + 1) == 1) { mx.push_back(i); mn.push_back(i + 1); } else { mx.push_back(i + 1); mn.push_back(i); } } if (i == N - 1) mx.push_back(N - 1), mn.push_back(N - 1); mni = mn[0], mxi = mx[0]; for (i = 1; i < mn.size(); i++) if (Compare(mni, mn[i]) == 1) mni = mn[i]; for (i = 1; i < mx.size(); i++) if (Compare(mxi, mx[i]) == -1) mxi = mx[i]; Answer(mni, mxi); }

Compilation message (stderr)

ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:20:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 1; i < mn.size(); i++) if (Compare(mni, mn[i]) == 1) mni = mn[i];
              ~~^~~~~~~~~~~
ramen.cpp:21:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 1; i < mx.size(); i++) if (Compare(mxi, mx[i]) == -1) mxi = mx[i];
              ~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...