Submission #578

# Submission time Handle Problem Language Result Execution time Memory
578 2013-02-28T14:24:46 Z gs13068 올림픽 피자 (tutorial5) C++
Compilation error
0 ms 0 KB
#include"grader.h"
#include<vector>

void Init(){}

int v[256][100000];
int f[256],b[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][b[j]++]=ordern++;
 
  do
  {
    min=-1;
    flag=false;
    for(i=0;i<256;i++)
    {
      if(i&can!=i)continue;
      flag=true;
      if(f[i]<b[i]&&(v[i][f[i]]<v[min][f[min]]||min==-1))
        min=i;
    }
    if(flag)
    {
      Bake(v[min][f[min]]);
      f[min]++;
      for(i=0;i<8;i++)
      {
        if(max&(1<<i))
        {
          jaeryo[i]--;
          if(jaeryo[i]==0)
          	can^=1<<i;
        }
      }
    }
  }while(flag);
}

void Delivery(int x)
{
  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;
      flag=true;
      if(f[i]<b[i]&&(v[i][f[i]]<v[min][f[min]]||min==-1))
        min=i;
    }
    if(flag)
    {
      Bake(v[min][f[min]]);
      f[min]++;
      for(i=0;i<8;i++)
      {
        if(max&(1<<i))
        {
          jaeryo[i]--;
          if(jaeryo[i]==0)
          	can^=1<<i;
        }
      }
    }
  }while(flag);
}

Compilation message

tutorial5.cpp:1:19: error: grader.h: No such file or directory
tutorial5.cpp: In function 'void Order(int, int*)':
tutorial5.cpp:34: error: 'Bake' was not declared in this scope
tutorial5.cpp:38: error: 'max' was not declared in this scope
tutorial5.cpp: In function 'void Delivery(int)':
tutorial5.cpp:56: error: 'min' was not declared in this scope
tutorial5.cpp:57: error: 'flag' was not declared in this scope
tutorial5.cpp:58: error: 'i' was not declared in this scope
tutorial5.cpp:67: error: 'Bake' was not declared in this scope
tutorial5.cpp:71: error: 'max' was not declared in this scope
tutorial5.cpp:79: error: 'flag' was not declared in this scope