# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
991032 | 2024-06-01T05:59:47 Z | lalig777 | Last supper (IOI12_supper) | C++14 | 0 ms | 0 KB |
#include "advisor.h" #include <iostream> #include <vector> #include <unordered_set> #include <queue> using namespace std; void ComputeAdvice(vector<int>C, int N, int K, int M){ vector<int>orden(N, 0); for (int i=0; i<N; i++) orden[C[i]]++; for (int i=0; i<K; i++){ if (orden[i]==0) WriteAdvice(0); else WriteAdvice(1); } for (int i=0; i<N; i++){ int x=C[i]; orden[x]--; if (orden[x]==0) WriteAdvice(0); else WriteAdvice(1); }return; }