#include "grid.h"
typedef std::vector<int> VI;
// ģ�� ���� �����
VI makeSeq(int N, int start, VI &found) {
VI v(N);
for (int i = 0, count = 0; count < N; ++count) {
int num = (start + i) % N;
// �ش� ģ���� ���̰� �������ٸ�.
if (found[num] > 0) {
int id = found[num] - 1; // "L - 1" means idx.
v[id] = num;
continue;
}
v[i] = num;
++i;
}
return v;
}
VI SortDisks(int N) {
VI found(N, 0);
int max_h = N + (N - 1);
for (int k = N - 1; k >= 0; --k) {
for (int i = 0; i < N; ++i) {
VI v = makeSeq(N, i, found);
int X = PutDisks(v);
if (X != max_h)
continue;
found[k] = v[0];
--max_h;
break;
}
}
return found;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |