# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
988841 | 2024-05-26T12:40:36 Z | lalig777 | 최후의 만찬 (IOI12_supper) | C++14 | 204 ms | 77184 KB |
#include "advisor.h" #include <iostream> #include <vector> #include <unordered_set> #include <queue> using namespace std; void ComputeAdvice(int *C, int N, int K, int M){ int digits; for (int i=0; i<21; i++){ if ((1<<i)>=N-1){ digits=i; break; } } if (K==1) return; unordered_set<int>current; priority_queue<pair<int,int>>next; vector<queue<int>>orden(N); for (int i=0; i<N; i++){ int x=C[i]; if (x<K){ if (!(current.find(x)!=current.end())){ next.push(make_pair(i, x)); current.insert(x); } }orden[x].push(i); }for (int i=0; i<K; i++){ if (!(current.find(i)!=current.end())){ next.push(make_pair(1e9, i)); current.insert(i); } } for (int i=0; i<N; i++){ int x=C[i]; orden[x].pop(); int pos; if (orden[x].empty()) pos=1e9; else pos=orden[x].front(); if (!(current.find(x)!=current.end())){ current.insert(x); int remov=next.top().second; next.pop(); current.erase(remov); for (int j=digits-1; j>=0; j--){ int y=1<<j; if (remov>=y){ remov-=y; WriteAdvice(1); }else WriteAdvice(0); } } next.push(make_pair(pos, x)); }return; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 792 KB | Error - Putting back a color that is not on the scaffold |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 16 ms | 8028 KB | Error - Putting back a color that is not on the scaffold |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 127 ms | 60616 KB | Error - Putting back a color that is not on the scaffold |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 3876 KB | Error - advice is too long |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 170 ms | 75356 KB | Error - Putting back a color that is not on the scaffold |
2 | Incorrect | 162 ms | 75972 KB | Error - Putting back a color that is not on the scaffold |
3 | Incorrect | 156 ms | 75740 KB | Error - Putting back a color that is not on the scaffold |
4 | Incorrect | 156 ms | 75768 KB | Error - Putting back a color that is not on the scaffold |
5 | Incorrect | 154 ms | 75908 KB | Error - Putting back a color that is not on the scaffold |
6 | Incorrect | 159 ms | 76112 KB | Error - Putting back a color that is not on the scaffold |
7 | Incorrect | 155 ms | 75688 KB | Error - Putting back a color that is not on the scaffold |
8 | Incorrect | 157 ms | 75712 KB | Error - Putting back a color that is not on the scaffold |
9 | Incorrect | 158 ms | 75936 KB | Error - Putting back a color that is not on the scaffold |
10 | Incorrect | 204 ms | 77184 KB | Error - Putting back a color that is not on the scaffold |