#include "pizza.h"
void Init(){}
int cnt[8],chk[1<<8][100010],s[1<<8],e[1<<8],m;
void Order(int n, int *a){
int i,t=0;
for(i=0;i<n;++i)if(!cnt[a[i]])break;
if(i<n){
for(i=0;i<n;++i)t+=(1<<a[i]);
chk[t][++e[t]]=m++;
}
else{
Bake(m++);
for(i=0;i<n;++i)--cnt[a[i]];
}
}
void Delivery(int x){
int i,j;
++cnt[x];
if(cnt[x]<2){
for(i=1;i<(1<<8);++i)if(i&(1<<x)){
for(j=0;j<8;++j)if(i&(1<<j)&&!cnt[j])break;
if(j>7&&s[i]<e[i]){
for(j=0;j<8;++j)if(i&(1<<j))--cnt[j];
Bake(chk[i][++s[i]]);
return;
}
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
101096 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
101096 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
39 ms |
101096 KB |
Output is correct |
2 |
Correct |
24 ms |
101096 KB |
Output is correct |
3 |
Correct |
36 ms |
101096 KB |
Output is correct |
4 |
Correct |
44 ms |
101096 KB |
Output is correct |
5 |
Correct |
50 ms |
101096 KB |
Output is correct |
6 |
Correct |
45 ms |
101096 KB |
Output is correct |
7 |
Correct |
35 ms |
101096 KB |
Output is correct |
8 |
Correct |
43 ms |
101096 KB |
Output is correct |
9 |
Correct |
48 ms |
101096 KB |
Output is correct |
10 |
Correct |
40 ms |
101096 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
83 ms |
101096 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |