Submission #781884

#TimeUsernameProblemLanguageResultExecution timeMemory
781884ymm라멘 (JOI14_ramen)C++17
100 / 100
1 ms288 KiB
#include "ramen.h" void Ramen(int N) { int a[300], b[300]; for (int i = 0; i < N; i += 2) { if (i+1 >= N) { a[i/2] = b[i/2] = i; } else if (Compare(i, i+1) < 0) { a[i/2] = i; b[i/2] = i+1; } else { a[i/2] = i+1; b[i/2] = i; } } int mx = b[0]; for (int i = 1; i < (N+1)/2; ++i) { if (Compare(mx, b[i]) < 0) mx = b[i]; } int mn = a[0]; for (int i = 1; i < (N+1)/2; ++i) { if (Compare(mn, a[i]) > 0) mn = a[i]; } Answer(mn, mx); }

Compilation message (stderr)

ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:16:6: warning: 'b[0]' may be used uninitialized in this function [-Wmaybe-uninitialized]
   16 |  int mx = b[0];
      |      ^~
ramen.cpp:21:6: warning: 'a[0]' may be used uninitialized in this function [-Wmaybe-uninitialized]
   21 |  int mn = a[0];
      |      ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...