# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
813388 | Andrey | Last supper (IOI12_supper) | C++14 | 2601 ms | 4304 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "advisor.h"
using namespace std;
void ComputeAdvice(int *c, int n, int k, int m) {
vector<int> br(n);
for(int i = 0; i < n; i++) {
br[c[i]]++;
}
for(int i = 0; i < n; i++) {
for(int j = 0; j < br[i]; j++) {
WriteAdvice(1);
}
WriteAdvice(0);
}
}
#include<bits/stdc++.h>
#include "assistant.h"
using namespace std;
void Assist(unsigned char *a, int n, int k, int r) {
vector<int> br(n);
int y = 0,b,sm = 0,p;
vector<bool> bruh(n);
vector<bool> prot(n);
for(int i = 0; i < k; i++) {
bruh[i] = true;
}
for(int i = 0; i < n; i++) {
b = GetRequest();
if(!bruh[b]) {
p = -1;
sm = INT_MAX;
for(int j = 0; j < n; j++) {
if(bruh[j] == true && prot[j] == false && br[j] < sm) {
sm = br[j];
p = j;
}
}
PutBack(p);
bruh[p] = false;
prot[p] = false;
for(int j = 0; j < n; j++) {
if(bruh[j] && br[j] > 1) {
prot[j] = true;
}
}
bruh[b] = true;
}
prot[b] = false;
br[b]--;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |