Submission #19228

# Submission time Handle Problem Language Result Execution time Memory
19228 2016-02-21T12:35:10 Z LK149 올림픽 피자 (tutorial5) C++
0 / 100
1000 ms 1960 KB
#include "pizza.h"

int order_num;
int s[9] = { 0 };
bool o[100000][9];

void can_bake(){
    for (int i = 0; i<order_num; i++)
    {
        if (o[i][0]){
            for (int j = 1; j <= 8; j++)
            {
                if (o[i][j] && (s[j] >= 1))
                {
                    o[i][j]=false; s[j]--;
                }
            }
            int sum = 0;
            for (int j = 1; j <= 8; j++)
            {
                sum += o[i][j];
            }
            if (sum == 0)
            {
                o[i][0] = 0;
                return Bake(i);
            }
        }
    }
}
void Init() {

    order_num = 0;

}

void Order(int N, int *A) {
    o[order_num][0] = 1;
    for (int i = 0; i<N; i++){
        o[order_num][++A[i]]++;
    }
    order_num++;
    can_bake();
}

void Delivery(int I) {
    s[++I]++;
    can_bake();
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1960 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 212 ms 1960 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 1960 KB Program timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 1960 KB Program timed out
2 Halted 0 ms 0 KB -