Submission #73965

# Submission time Handle Problem Language Result Execution time Memory
73965 2018-08-29T12:21:27 Z sebinkim Last supper (IOI12_supper) C++14
0 / 100
122 ms 6616 KB
#include "advisor.h"

#include <bits/stdc++.h>

using namespace std;

typedef pair <int, int> pii;

static int P[101010], K[101010];
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 + 1;
	
	for(i=n-1; i>=0; i--){
		K[k + i] = P[C[i]];
		P[C[i]] = 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 time Memory Grader output
1 Correct 4 ms 752 KB Output is correct
2 Incorrect 4 ms 1192 KB Output isn't correct - not an optimal way
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 1560 KB Error - Putting back a color that is not on the scaffold
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 80 ms 5536 KB Error - Putting back a color that is not on the scaffold
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 5536 KB Output isn't correct - not an optimal way
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 6296 KB Error - Putting back a color that is not on the scaffold
2 Incorrect 88 ms 6296 KB Error - Putting back a color that is not on the scaffold
3 Incorrect 99 ms 6552 KB Error - Putting back a color that is not on the scaffold
4 Incorrect 100 ms 6552 KB Error - Putting back a color that is not on the scaffold
5 Incorrect 122 ms 6616 KB Error - Putting back a color that is not on the scaffold
6 Incorrect 100 ms 6616 KB Error - Putting back a color that is not on the scaffold
7 Incorrect 86 ms 6616 KB Error - Putting back a color that is not on the scaffold
8 Incorrect 96 ms 6616 KB Error - Putting back a color that is not on the scaffold
9 Incorrect 98 ms 6616 KB Error - Putting back a color that is not on the scaffold
10 Incorrect 97 ms 6616 KB Error - Putting back a color that is not on the scaffold