Submission #10688

#TimeUsernameProblemLanguageResultExecution timeMemory
10688dohyun0324라멘 (JOI14_ramen)C++98
100 / 100
0 ms1128 KiB
#include "ramen.h" int a[410],b[410],w1,w2; void Ramen(int N) { int i,s,p,q; if(N==1) Answer(0,0); for(i=0;i<N-1;i+=2) { s=Compare(i,i+1); if(s==1) a[++w1]=i, b[++w2]=i+1; else a[++w1]=i+1, b[++w2]=i; } if(N%2==1) a[++w1]=N-1, b[++w2]=N-1; p=a[1]; for(i=2;i<=w1;i++) { s=Compare(p,a[i]); if(s==-1) p=a[i]; } q=b[1]; for(i=2;i<=w2;i++) { s=Compare(q,b[i]); if(s==1) q=b[i]; } Answer(q,p); }

Compilation message (stderr)


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