#include "advisor.h"
#include <bits/stdc++.h>
using namespace std;
void ComputeAdvice(int *c, int n, int k, int m){
vector<int> occ[n];
for(int i = n-1;i>=0;i--){
occ[c[i]].push_back(i);
}
for(int i = 0;i<k;i++){
WriteAdvice(occ[i].empty());
}
for(int i = 0;i<n;i++){
occ[c[i]].pop_back();
WriteAdvice(occ[c[i]].empty());
}
}
#include "assistant.h"
#include <bits/stdc++.h>
using namespace std;
void Assist(unsigned char *a, int n, int k, int r) {
set<int> s;
int last = 0;
bool now[n];
for(int i = 0;i<n;i++){
now[i] = 0;
}
for(int i = 0;i<k;i++){
if(a[last++] == 1){
s.insert(i);
}
now[i] = 1;
}
return;
for (int i = 0; i < n; i++) {
int req = GetRequest();
if(now[req] == 0){
assert(s.size());
now[*s.begin()] = 0;
PutBack(*s.begin());
s.erase(s.begin());
now[req] = 1;
}
if(a[last++] == 1){
s.insert(req);
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
516 KB |
Error - GetRequest() must be called N times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
1356 KB |
Error - GetRequest() must be called N times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
48 ms |
6592 KB |
Error - GetRequest() must be called N times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
796 KB |
Error - GetRequest() must be called N times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
53 ms |
8016 KB |
Error - GetRequest() must be called N times |
2 |
Incorrect |
64 ms |
8168 KB |
Error - GetRequest() must be called N times |
3 |
Incorrect |
56 ms |
8124 KB |
Error - GetRequest() must be called N times |
4 |
Incorrect |
69 ms |
8180 KB |
Error - GetRequest() must be called N times |
5 |
Incorrect |
56 ms |
8320 KB |
Error - GetRequest() must be called N times |
6 |
Incorrect |
61 ms |
8356 KB |
Error - GetRequest() must be called N times |
7 |
Incorrect |
56 ms |
8200 KB |
Error - GetRequest() must be called N times |
8 |
Incorrect |
57 ms |
8172 KB |
Error - GetRequest() must be called N times |
9 |
Incorrect |
65 ms |
8260 KB |
Error - GetRequest() must be called N times |
10 |
Incorrect |
61 ms |
8848 KB |
Error - GetRequest() must be called N times |