Submission #16795

#TimeUsernameProblemLanguageResultExecution timeMemory
16795kdh9949라멘 (JOI14_ramen)C++98
100 / 100
0 ms1124 KiB
#include "ramen.h" int big[201],small[201],mx,mn; void Ramen(int N) { if(N==1){ Answer(0,0); return; } for(int i=0;i<N/2;i++){ if(Compare(2*i,2*i+1)==1){ big[i]=2*i; small[i]=2*i+1; } else{ big[i]=2*i+1; small[i]=2*i; } } if(N%2)big[N/2]=small[N/2]=N-1; mx=big[0]; mn=small[0]; for(int i=1;i<N/2+N%2;i++){ if(Compare(big[i],mx)==1)mx=big[i]; } for(int i=1;i<N/2+N%2;i++){ if(Compare(small[i],mn)==-1)mn=small[i]; } Answer(mn,mx); }

Compilation message (stderr)


#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...