Submission #73966

#TimeUsernameProblemLanguageResultExecution timeMemory
73966sebinkimLast supper (IOI12_supper)C++14
0 / 100
129 ms6872 KiB
#include "advisor.h" #include <bits/stdc++.h> using namespace std; typedef pair <int, int> pii; static int P[151515], K[151515]; static priority_queue <pii> Q; static bool chk[151515]; void ComputeAdvice(int *C, int n, int k, int m) { int i; for(i=0; i<n; i++) P[i] = n + k + 1; for(i=n-1; i>=0; i--){ K[k + i] = P[C[i]]; P[C[i]] = k + i; } for(i=0; i<k; i++){ K[i] = P[i]; P[i] = i; Q.push(pii(K[i], i)); } for(i=0; i<n; i++){ chk[Q.top().second] = 1; Q.pop(); Q.push(pii(K[k + i], k + i)); } for(i=0; i<n+k; i++){ WriteAdvice(chk[i]); } }
#include "assistant.h" #include <bits/stdc++.h> using namespace std; static queue <int> Q; static bool chk[101010]; void Assist(unsigned char *A, int n, int k, int r) { int i, c; for(i=0; i<k; i++){ if(A[i]) Q.push(i); chk[i] = 1; } for(i=0; i<n; i++){ c = GetRequest(); if(!chk[c]){ chk[Q.front()] = 0; PutBack(Q.front()); Q.pop(); } if(A[k + i]) Q.push(c); chk[c] = 1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...