# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
18817 | 2016-02-15T22:08:01 Z | ggoh | Last supper (IOI12_supper) | C++ | 0 ms | 0 KB |
#include "advisor.h" int late[100002],color[100002]; void ComputeAdvice(int *C, int N, int K, int M) { for(int i=0;i<N;i++)color[i]=C[i],late[i]=-1; for(int i=0;i<N;i++) { late[color[i]]=i; } for(int i=0;i<K;i++) { if(late[i]==-1)WriteAdvice(1); else WriteAdvice(0); } for(int i=0;i<N;i++) { if(late[color[i]]==i) { WriteAdvice(1); } else WriteAdvice(0); } }