Submission #236052

#TimeUsernameProblemLanguageResultExecution timeMemory
236052hhs2u라멘 (JOI14_ramen)C++17
100 / 100
5 ms384 KiB
#include "ramen.h" void Ramen(int N) { int a[222],b[222],cnt=0; int mx,mn; for(int i=0;i<N;i+=2) { if(i==N-1) a[cnt]=i,b[cnt]=i; else { if(Compare(i,i+1)==1) a[cnt]=i,b[cnt]=i+1; else b[cnt]=i,a[cnt]=i+1; } cnt++; } mx=a[0],mn=b[0]; for(int i=1;i<cnt;i++) { if(Compare(a[i],mx)==1) mx=a[i]; } for(int i=1;i<cnt;i++) { if(Compare(mn,b[i])==1) mn=b[i]; } Answer(mn,mx); return; }

Compilation message (stderr)

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