#include "advisor.h"
#include <bits/stdc++.h>
#ifndef EVAL
#include "grader.cpp"
#endif
using namespace std;
#define lol long long
#define pii pair<int,int>
#define OK puts("OK");
#define NO puts("NO");
#define YES puts("YES");
#define fr first
#define sc second
#define ret return
#define scanl(a) scanf("%lld",&a);
#define scanll(a,b) scanf("%lld %lld",&a, &b);
#define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c);
#define scan1(a) scanf("%d",&a);
#define scan2(a,b) scanf("%d %d",&a, &b);
#define scan3(a,b,c) scanf("%d %d %d",&a,&b,&c);
#define all(s) s.begin(),s.end()
#define allr(s) s.rbegin(),s.rend()
#define pb push_back
#define sz(v) (int)v.size()
#define endi puts("");
#define eps 1e-12
int vis[100001],predok[100001],is[100001],INF = 1e9+7;
void ComputeAdvice(int *c, int N, int K, int M) {
int i,n = 18;
priority_queue <pii> q;
for (i=0;i<N;++i){
vis[i] = INF;
}
for (i=N-1;i>=0;--i){
predok[i] = vis[c[i]];
vis[c[i]] = i;
}
for (i=0;i<K;++i){
q.push({vis[i],i});
is[i]=1;
}
for (i=0;i<N;++i){
if (is[c[i]]){
for (i=0;i<n;++i)WriteAdvice(1);
}
else {
int x = q.top().sc;q.pop();
for (i=0;i<n;++i){
if ((x&(1<<i)))WriteAdvice(1);
else WriteAdvice(0);
}
q.push({predok[i],c[i]});
}
}
}
#include "assistant.h"
#include <bits/stdc++.h>
#ifndef EVAL
#include "grader.cpp"
#endif
using namespace std;
#define lol long long
#define pii pair<int,int>
#define OK puts("OK");
#define NO puts("NO");
#define YES puts("YES");
#define fr first
#define sc second
#define ret return
#define scanl(a) scanf("%lld",&a);
#define scanll(a,b) scanf("%lld %lld",&a, &b);
#define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c);
#define scan1(a) scanf("%d",&a);
#define scan2(a,b) scanf("%d %d",&a, &b);
#define scan3(a,b,c) scanf("%d %d %d",&a,&b,&c);
#define all(s) s.begin(),s.end()
#define allr(s) s.rbegin(),s.rend()
#define pb push_back
#define sz(v) (int)v.size()
#define endi puts("");
#define eps 1e-12
void Assist(unsigned char *A, int N, int K, int R) {
int i,n = 18,j;
for (i = 0; i < N; i++) {
for (j = 0;j<n;++j){
int req = GetRequest();
cout <<req;
}
endi
i+=n-1;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
868 KB |
Hacked |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
3044 KB |
Error - advice is too long |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
29 ms |
3872 KB |
Error - advice is too long |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
868 KB |
Error - advice is too long |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
35 ms |
4080 KB |
Error - advice is too long |
2 |
Incorrect |
37 ms |
4220 KB |
Error - advice is too long |
3 |
Incorrect |
23 ms |
4064 KB |
Error - advice is too long |
4 |
Incorrect |
23 ms |
4272 KB |
Error - advice is too long |
5 |
Incorrect |
36 ms |
4192 KB |
Error - advice is too long |
6 |
Incorrect |
35 ms |
4272 KB |
Error - advice is too long |
7 |
Incorrect |
32 ms |
4192 KB |
Error - advice is too long |
8 |
Incorrect |
36 ms |
4192 KB |
Error - advice is too long |
9 |
Incorrect |
34 ms |
4064 KB |
Error - advice is too long |
10 |
Incorrect |
31 ms |
4128 KB |
Error - advice is too long |