Submission #18820

# Submission time Handle Problem Language Result Execution time Memory
18820 2016-02-15T22:27:23 Z ggoh Last supper (IOI12_supper) C++
Compilation error
0 ms 0 KB
#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+1;
    for(int i=0;i<K;i++)WriteAdvice((L[i]+1?0:1));
    for(int i=0;i<N;i++)WriteAdvice((late[C[i]]-i?0:1));
}
#include "assistant.h"
int sz,del,G[100002],T[100002],c[100002],p,S[100002];
void Assist(unsigned char *A, int N, int K, int R)
{
    for(int i=0;i<N;i++)G[i]=-1;
    for(int i=0;i<K;i++)
    {
        S[i]=G[i]=i;
      	c[i]=A[i];
      	if(c[i])T[sz++]=i;
    }
    for(int i=0;i<N;i++)
    {
        p=GetRequest();
        check=A[K+i];
        if(go[p]+1)
        {
            if(A[K+i])c[G[p]]=1,T[sz++]=G[p];
        }
        else
        {
          	del=(sz?T[--sz]:0);
          	PutBack(S[del]);
          	G[S[del]]=-1;
          	S[del]=p;
          	ch[del]=A[K+i];
          	ho[p]=del;
        }
    }
}

Compilation message

advisor.cpp: In function 'void ComputeAdvice(int*, int, int, int)':
advisor.cpp:8:38: error: 'late' was not declared in this scope
     for(int i=0;i<N;i++)WriteAdvice((late[C[i]]-i?0:1));
                                      ^~~~

assistant.cpp: In function 'void Assist(unsigned char*, int, int, int)':
assistant.cpp:15:9: error: 'check' was not declared in this scope
         check=A[K+i];
         ^~~~~
assistant.cpp:16:12: error: 'go' was not declared in this scope
         if(go[p]+1)
            ^~
assistant.cpp:26:12: error: 'ch' was not declared in this scope
            ch[del]=A[K+i];
            ^~
assistant.cpp:26:12: note: suggested alternative: 'c'
            ch[del]=A[K+i];
            ^~
            c
assistant.cpp:27:12: error: 'ho' was not declared in this scope
            ho[p]=del;
            ^~