#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) {
return;
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);
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
608 KB |
Error - GetRequest() must be called N times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
1392 KB |
Error - GetRequest() must be called N times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
53 ms |
6332 KB |
Error - GetRequest() must be called N times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
772 KB |
Error - GetRequest() must be called N times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
63 ms |
7776 KB |
Error - GetRequest() must be called N times |
2 |
Incorrect |
68 ms |
7800 KB |
Error - GetRequest() must be called N times |
3 |
Incorrect |
66 ms |
7800 KB |
Error - GetRequest() must be called N times |
4 |
Incorrect |
59 ms |
7772 KB |
Error - GetRequest() must be called N times |
5 |
Incorrect |
57 ms |
7792 KB |
Error - GetRequest() must be called N times |
6 |
Incorrect |
73 ms |
7832 KB |
Error - GetRequest() must be called N times |
7 |
Incorrect |
56 ms |
7840 KB |
Error - GetRequest() must be called N times |
8 |
Incorrect |
61 ms |
7892 KB |
Error - GetRequest() must be called N times |
9 |
Incorrect |
64 ms |
7816 KB |
Error - GetRequest() must be called N times |
10 |
Incorrect |
77 ms |
8812 KB |
Error - GetRequest() must be called N times |