# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
143123 | 2019-08-13T05:57:15 Z | bupjae | 올림픽 피자 (tutorial5) | C++17 | 1000 ms | 2084 KB |
#include "pizza.h" #include <algorithm> #include <list> struct order { int id; int need_mask; }; int next_id; int have_mask; int have[8]; std::list<order> *orders = nullptr; void Init() { next_id = 0; have_mask = 0; std::fill(have, have+8, 0); delete orders; orders = new std::list<order>(); } void check() { auto d = orders->begin(); while (d != orders->end()) { if ((d->need_mask & have_mask) == d->need_mask) { Bake(d->id); for (int i = 0; i < 8; i++) if ((d->need_mask & (1 << i)) != 0 && --have[i] == 0) have_mask &= ~(1 << i); d = orders->erase(d); } else { ++d; } } } void Order(int N, int *A) { int k = 0; for (int i = 0; i < N; i++) k |= 1 << A[i]; orders->emplace_back(order{next_id, k}); ++next_id; check(); } void Delivery(int I) { if (have[I] == 0) have_mask |= 1 << I; have[I]++; check(); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 380 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 252 KB | Output is correct |
9 | Correct | 2 ms | 256 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 16 ms | 376 KB | Output is correct |
2 | Correct | 17 ms | 376 KB | Output is correct |
3 | Correct | 17 ms | 376 KB | Output is correct |
4 | Correct | 17 ms | 376 KB | Output is correct |
5 | Correct | 16 ms | 424 KB | Output is correct |
6 | Correct | 17 ms | 412 KB | Output is correct |
7 | Correct | 17 ms | 376 KB | Output is correct |
8 | Correct | 16 ms | 376 KB | Output is correct |
9 | Correct | 15 ms | 376 KB | Output is correct |
10 | Correct | 16 ms | 376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1070 ms | 2084 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1025 ms | 1496 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |