Submission #13904

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
139042015-04-18 10:08:42minsu올림픽 피자 (tutorial5)C++14
100 / 100
98 ms1860 KiB
#include "pizza.h"
#include <queue>
#include <algorithm>
using namespace std;
const int INF=987654321;
queue<int> pizza[1<<8];
int on=0,cnt[8];
void Init(){
}
void chk(){
int avpiz=0, minnum=INF, minq;
for(int i=0;i<8;i++)
if(cnt[i]) avpiz|=1<<i;
for(int i=0;i<1<<8;i++){
if(i - (i & avpiz) == 0 && !pizza[i].empty()){
if(minnum>pizza[i].front()){
minnum=pizza[i].front();
minq=i;
}
}
}
if(minnum!=INF){
Bake(minnum); pizza[minq].pop();
for(int i=0;i<8;i++)
if(minq & (1<<i)){
cnt[i]--;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...