#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;
}
for (int i = 0; i < n; i++) {
int req = GetRequest();
if(now[req] == 0){
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 |
Correct |
0 ms |
520 KB |
Output is correct |
2 |
Correct |
1 ms |
516 KB |
Output is correct |
3 |
Correct |
2 ms |
768 KB |
Output is correct |
4 |
Incorrect |
2 ms |
660 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 |
Execution timed out |
2546 ms |
1328 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
65 ms |
7124 KB |
Output is correct |
2 |
Correct |
80 ms |
8876 KB |
Output is correct |
3 |
Correct |
88 ms |
8980 KB |
Output is correct |
4 |
Correct |
73 ms |
8696 KB |
Output is correct |
5 |
Execution timed out |
2507 ms |
7496 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
920 KB |
Output is correct |
2 |
Execution timed out |
2585 ms |
1004 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
57 ms |
8180 KB |
Error - Putting back a color that is not on the scaffold |
2 |
Correct |
68 ms |
8740 KB |
Output is correct - 122000 bits used |
3 |
Correct |
73 ms |
9044 KB |
Output is correct - 125000 bits used |
4 |
Correct |
72 ms |
8940 KB |
Output is correct - 125000 bits used |
5 |
Correct |
68 ms |
8940 KB |
Output is correct - 125000 bits used |
6 |
Correct |
80 ms |
8952 KB |
Output is correct - 125000 bits used |
7 |
Correct |
72 ms |
8940 KB |
Output is correct - 124828 bits used |
8 |
Correct |
83 ms |
8840 KB |
Output is correct - 124910 bits used |
9 |
Correct |
77 ms |
8864 KB |
Output is correct - 125000 bits used |
10 |
Execution timed out |
2508 ms |
8972 KB |
Time limit exceeded |