# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
150062 | | Outfraware Boat People (#200) | On the Grid (FXCUP4_grid) | C++17 | | 10 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "grid.h"
typedef std::vector<int> VI;
bool visit[1001] = { 0, };
VI v;
int total = 0;
// � ���� �����
void makeSeq(int N, int start, VI &found) {
for (int i = 0, count = 0; count < N; ++count) {
int num = (start + count) % N;
if (visit[num])
continue;
v[i++] = num;
if (i == N - total)
return;
}
}
VI SortDisks(int N) {
VI found(N, 0);
v = found;
int max_h = N + (N - 1);
for (int L = N; L >= 1; --L) {
for (int i = 0; i < N; ++i) {
//VI v = makeSeq(N, i, found, len_friend);
makeSeq(N, i, found);
int X = PutDisks(v);
if (X != max_h)
continue;
found[v[0]] = L;
visit[v[0]] = true;
v[L - 1] = v[0];
++total;
--max_h;
break;
}
}
return found;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |