Submission #6000

#TimeUsernameProblemLanguageResultExecution timeMemory
6000baneling100라멘 (JOI14_ramen)C++98
100 / 100
0 ms1940 KiB
#include "ramen.h" #include <queue> using namespace std; queue <int> Q; void Ramen(int N) { int i, min1, max1, min2, max2, MIN, MAX; for(i=0 ; i<N ; i++) { Q.push(i); Q.push(i); } while(Q.size()>2) { min1=Q.front(); Q.pop(); max1=Q.front(); Q.pop(); min2=Q.front(); Q.pop(); max2=Q.front(); Q.pop(); if(min1==max1 && min2==max2) { if(Compare(min1,min2)==-1) { MIN=min1; MAX=min2; } else { MIN=min2; MAX=min1; } } else { if(Compare(min1,min2)==-1) MIN=min1; else MIN=min2; if(Compare(max1,max2)==1) MAX=max1; else MAX=max2; } Q.push(MIN); Q.push(MAX); } MIN=Q.front(); Q.pop(); MAX=Q.front(); Q.pop(); Answer(MIN,MAX); }

Compilation message (stderr)


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