# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
361918 | 2021-02-01T06:58:18 Z | benedict0724 | Last supper (IOI12_supper) | C++17 | 25 ms | 8740 KB |
#include "advisor.h" #include <deque> #include <queue> using namespace std; deque<int> useWhen[5000]; queue<int> ret; int shelf[5000]; void ComputeAdvice(int *C, int N, int K, int M) { int logN = 0; while(N + 1 <= (1<<logN)) logN++; for(int i=0;i<K;i++){ shelf[i] = i; } for(int i=0;i<N;i++){ useWhen[C[i]].push_back(i); } for(int i=0;i<N;i++){ bool flag = false; for(int j=0;j<K;j++){ if(shelf[j] == C[i]) flag = true; } if(!flag){ int m = 0; for(int j=0;j<K;j++){ if(useWhen[shelf[m]].front() < useWhen[shelf[j]].front()) m = j; } shelf[m] = C[i]; ret.push(C[i]); } else{ ret.push((1<<logN) - 1); } } while(!ret.empty()){ int now = ret.front(); ret.pop(); for(int i=0;i<logN;i++){ if((1<<i) & now) WriteAdvice(1); else WriteAdvice(0); } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 4072 KB | Error - Not putting back color when it is not on the scaffold |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 8 ms | 7404 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 25 ms | 8428 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 20 ms | 4496 KB | Error - Not putting back color when it is not on the scaffold |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 24 ms | 8684 KB | Execution killed with signal 11 |
2 | Runtime error | 22 ms | 8740 KB | Execution killed with signal 11 |
3 | Runtime error | 20 ms | 8704 KB | Execution killed with signal 11 |
4 | Runtime error | 20 ms | 8684 KB | Execution killed with signal 11 |
5 | Runtime error | 19 ms | 8684 KB | Execution killed with signal 11 |
6 | Runtime error | 19 ms | 8684 KB | Execution killed with signal 11 |
7 | Runtime error | 20 ms | 8684 KB | Execution killed with signal 11 |
8 | Runtime error | 20 ms | 8684 KB | Execution killed with signal 11 |
9 | Runtime error | 19 ms | 8684 KB | Execution killed with signal 11 |
10 | Runtime error | 19 ms | 8684 KB | Execution killed with signal 11 |