Submission #18816

#TimeUsernameProblemLanguageResultExecution timeMemory
18816ggohLast supper (IOI12_supper)C++98
0 / 100
2163 ms5504 KiB
#include "advisor.h" int late[100002],color[100002]; void ComputeAdvice(int *C, int N, int K, int M) { for(int i=0;i<N;i++)color[i]=C[i],late[i]=-1; for(int i=0;i<N;i++) { late[color[i]]=i; } for(int i=0;i<K;i++) { if(late[i]==-1)WriteAdvice(1); else WriteAdvice(0); } for(int i=0;i<N;i++) { if(late[color[i]]==i) { WriteAdvice(1); } else WriteAdvice(0); } }
#include "assistant.h" int check,o,ch[100002],p,st[100002],sz,t; void Assist(unsigned char *A, int N, int K, int R) { for(int i=0;i<K;i++) { st[i]=i; if(A[i]==0) { ch[i]=0; } else { ch[i]=1; } } for(int i=0;i<N;i++) { p=GetRequest(); check=A[K+i]; o=0; int j; for(j=0;j<K;j++) { if(st[j]==p) { o=1;break; } } if(o==1) { if(check)ch[j]=1; } else { o=0; for(j=0;j<K;j++) { if(ch[j]==1) { o=1;break; } } if(o==1) { PutBack(st[j]); st[j]=p; ch[j]=check; } else { PutBack(st[0]); st[0]=p; ch[0]=check; } } } }
#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...