# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
593 |
2013-02-28T14:51:00 Z |
gs13068 |
올림픽 피자 (tutorial5) |
C++ |
|
33 ms |
948 KB |
#include"pizza.h"
#include<vector>
void Init(){}
std::vector<int> v[256];
int f[256];
int ordern;
int jaeryo[8];
int can;
void Order(int n,int *a)
{
bool flag;
int i,j=0,min;
for(i=0;i<n;i++)j=j|(1<<a[i]);
v[j].push_back(ordern++);
do
{
min=-1;
flag=false;
for(i=0;i<256;i++)
{
if((i&can)!=i)continue;
if(f[i]<v[i].size()&&(v[i][f[i]]<v[min][f[min]]||min==-1))
{
flag=true;
min=i;
}
}
if(flag)
{
Bake(v[min][f[min]]);
f[min]++;
for(i=0;i<8;i++)
{
if(min&(1<<i))
{
jaeryo[i]--;
if(jaeryo[i]==0)
can^=1<<i;
}
}
}
}while(flag);
}
void Delivery(int x)
{
int i,min;
bool flag;
if(jaeryo[x]==0)can|=1<<x;
jaeryo[x]++;
do
{
min=-1;
flag=false;
for(i=0;i<256;i++)
{
if(i&can!=i)continue;
if(f[i]<v[i].size()&&(v[i][f[i]]<v[min][f[min]]||min==-1))
{
flag=true;
min=i;
}
}
if(flag)
{
Bake(v[min][f[min]]);
f[min]++;
for(i=0;i<8;i++)
{
if(min&(1<<i))
{
jaeryo[i]--;
if(jaeryo[i]==0)
can^=1<<i;
}
}
}
}while(flag);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
948 KB |
SIGSEGV Segmentation fault |
2 |
Halted |
0 ms |
0 KB |
- |
3 |
Halted |
0 ms |
0 KB |
- |
4 |
Halted |
0 ms |
0 KB |
- |
5 |
Halted |
0 ms |
0 KB |
- |
6 |
Halted |
0 ms |
0 KB |
- |
7 |
Halted |
0 ms |
0 KB |
- |
8 |
Halted |
0 ms |
0 KB |
- |
9 |
Halted |
0 ms |
0 KB |
- |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
948 KB |
SIGSEGV Segmentation fault |
2 |
Halted |
0 ms |
0 KB |
- |
3 |
Halted |
0 ms |
0 KB |
- |
4 |
Halted |
0 ms |
0 KB |
- |
5 |
Halted |
0 ms |
0 KB |
- |
6 |
Halted |
0 ms |
0 KB |
- |
7 |
Halted |
0 ms |
0 KB |
- |
8 |
Halted |
0 ms |
0 KB |
- |
9 |
Halted |
0 ms |
0 KB |
- |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
33 ms |
948 KB |
SIGSEGV Segmentation fault |
2 |
Halted |
0 ms |
0 KB |
- |
3 |
Halted |
0 ms |
0 KB |
- |
4 |
Halted |
0 ms |
0 KB |
- |
5 |
Halted |
0 ms |
0 KB |
- |
6 |
Halted |
0 ms |
0 KB |
- |
7 |
Halted |
0 ms |
0 KB |
- |
8 |
Halted |
0 ms |
0 KB |
- |
9 |
Halted |
0 ms |
0 KB |
- |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
948 KB |
SIGSEGV Segmentation fault |
2 |
Halted |
0 ms |
0 KB |
- |
3 |
Halted |
0 ms |
0 KB |
- |
4 |
Halted |
0 ms |
0 KB |
- |
5 |
Halted |
0 ms |
0 KB |
- |
6 |
Halted |
0 ms |
0 KB |
- |
7 |
Halted |
0 ms |
0 KB |
- |
8 |
Halted |
0 ms |
0 KB |
- |
9 |
Halted |
0 ms |
0 KB |
- |
10 |
Halted |
0 ms |
0 KB |
- |