#include<bits/stdc++.h>
#include "advisor.h"
using namespace std;
void ComputeAdvice(int *c, int n, int k, int m) {
vector<int> br(n);
for(int i = 0; i < n; i++) {
br[c[i]]++;
}
for(int i = 0; i < n; i++) {
for(int j = 0; j < br[i]; i++) {
WriteAdvice(1);
}
WriteAdvice(0);
}
}
#include<bits/stdc++.h>
#include "assistant.h"
using namespace std;
void Assist(unsigned char *a, int n, int k, int r) {
vector<int> br(n);
int y = 0,b,sm = 0,p;
for(int i = 0; i < r; i++) {
if((int)a[i] == 0) {
y++;
}
else {
br[y]++;
}
}
vector<bool> bruh(n);
for(int i = 0; i < k; i++) {
bruh[i] = true;
}
for(int i = 0; i < n; i++) {
b = GetRequest();
if(!bruh[b]) {
p = -1;
sm = INT_MAX;
for(int j = 0; j < n; j++) {
if(bruh[j] == true && br[j] < sm) {
sm = br[j];
p = j;
}
}
PutBack(p);
br[p]--;
bruh[p] = false;
bruh[b]= true;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
508 KB |
Output isn't correct - not an optimal way |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
85 ms |
848 KB |
Output isn't correct - not an optimal way |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2581 ms |
3124 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
668 KB |
Output isn't correct - not an optimal way |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2579 ms |
3604 KB |
Time limit exceeded |
2 |
Execution timed out |
2586 ms |
3520 KB |
Time limit exceeded |
3 |
Execution timed out |
2506 ms |
3656 KB |
Time limit exceeded |
4 |
Execution timed out |
2591 ms |
3580 KB |
Time limit exceeded |
5 |
Execution timed out |
2600 ms |
3620 KB |
Time limit exceeded |
6 |
Execution timed out |
2507 ms |
3576 KB |
Time limit exceeded |
7 |
Execution timed out |
2505 ms |
3556 KB |
Time limit exceeded |
8 |
Execution timed out |
2506 ms |
3584 KB |
Time limit exceeded |
9 |
Execution timed out |
2577 ms |
3640 KB |
Time limit exceeded |
10 |
Execution timed out |
2509 ms |
3604 KB |
Time limit exceeded |