#include "advisor.h"
void ComputeAdvice(int *C, int N, int K, int M)
{
int L[100002];
for(int i=0;i<N;i++)L[i]=-1;
for(int i=0;i<N;i++)L[C[i]]=i;
for(int i=0;i<K;i++)WriteAdvice((L[i]+1?0:1));
for(int i=0;i<N;i++)WriteAdvice((L[C[i]]-i?0:1));
}
#include "assistant.h"
int sz,del,p,T[100002],c[100002];
void Assist(unsigned char *A, int N, int K, int R)
{
for(int i=0;i<K;i++)
{
c[i]=1;
if(A[i])T[sz++]=i;
}
for(int i=0;i<N;i++)
{
p=GetRequest();
if(!c[p])
{
PutBack(T[--sz]);
c[T[sz]]=0;c[p]=1;
}
if(A[K+i]||sz==0)T[sz++]=p;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
864 KB |
Output is correct |
2 |
Correct |
4 ms |
976 KB |
Output is correct |
3 |
Correct |
4 ms |
1116 KB |
Output is correct |
4 |
Incorrect |
6 ms |
1164 KB |
Output isn't correct - not an optimal way |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
1432 KB |
Output isn't correct - not an optimal way |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
60 ms |
4068 KB |
Output is correct |
2 |
Correct |
80 ms |
4880 KB |
Output is correct |
3 |
Correct |
83 ms |
5136 KB |
Output is correct |
4 |
Correct |
82 ms |
5136 KB |
Output is correct |
5 |
Incorrect |
70 ms |
5136 KB |
Output isn't correct - not an optimal way |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
5136 KB |
Output is correct |
2 |
Correct |
7 ms |
5136 KB |
Output is correct |
3 |
Correct |
6 ms |
5136 KB |
Output is correct |
4 |
Incorrect |
8 ms |
5136 KB |
Error - Putting back a color that is not on the scaffold |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
80 ms |
5136 KB |
Output isn't correct - not an optimal way |
2 |
Correct |
73 ms |
5136 KB |
Output is correct - 122000 bits used |
3 |
Correct |
110 ms |
5136 KB |
Output is correct - 125000 bits used |
4 |
Correct |
79 ms |
5136 KB |
Output is correct - 125000 bits used |
5 |
Correct |
75 ms |
5136 KB |
Output is correct - 125000 bits used |
6 |
Correct |
72 ms |
5188 KB |
Output is correct - 125000 bits used |
7 |
Correct |
67 ms |
5240 KB |
Output is correct - 124828 bits used |
8 |
Correct |
71 ms |
5240 KB |
Output is correct - 124910 bits used |
9 |
Correct |
71 ms |
5240 KB |
Output is correct - 125000 bits used |
10 |
Correct |
77 ms |
5248 KB |
Output is correct - 125000 bits used |