#include <bits/stdc++.h>
using namespace std;
int K;
vector < int > R;
int n;
vector < int > order;
int ord;
void init(int k, vector < int > r){
K = k;
R = r;
n = R.size();
order.resize(n);
for (int i = 0; i < n; ++i)
{
for(int ind = 0; ind < n; ind++){
if(R[ind] == 0){
bool b = false;
for(int c = 0; c < k; c++){
if(R[(ind - c + n) % n] == 0){
b = true;
ind = (ind - c + n) % n - 1;
break;
}
}
if(b){
continue;
}
for(int c = 0; c < k; c++){
R[(ind - c + n) % n]--;
}
order[ind] = ord;
//cout << ind << " ";
ord++;
break;
}
}
}
}
int compare_plants(int x, int y){
if(order[x] < order[y]){
return 1;
}
if(order[y] < order[x]){
return -1;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4006 ms |
416 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4083 ms |
364 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4083 ms |
364 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4089 ms |
364 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4053 ms |
364 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4030 ms |
492 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4006 ms |
416 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |