Submission #150610

# Submission time Handle Problem Language Result Execution time Memory
150610 2019-09-01T08:43:08 Z 본인 하지만 안 어림 ㅋㅋ(#3569, gs13105, xdoju, gs13068) On the Grid (FXCUP4_grid) C++17
43 / 100
56 ms 384 KB
#include "grid.h"
#include <algorithm>

using namespace std;

pair<int, int> a[1001];

std::vector<int> SortDisks(int N) {
	vector<int> t(N);
	int i, j, k, l, m = N;
	for (i = 0; i < N; i++) t[i] = i;
	for (i = 0; i < N; i++) {
		a[i].first = -N;
		a[i].second = i;
	}
	random_shuffle(a, a + N);
	while (m) {
		for (j = 0; j < N; j++) t[j] = a[j].second;
		k = PutDisks(t);
		l = 0;
		for (j = 0; j < m; j++) {
			if (a[j].first <= N - j - k - 1) l++;
			a[j].first = max(a[j].first, N - j - k - 1);
		}
		if (l == 1) {
			for (j = 0; j < m; j++) if (a[j].first == N - j - k - 1) {
				swap(a[j], a[--m]);
				break;
			}
		}
		sort(a, a + m);
	}
	for (j = 0; j < N; j++) t[a[j].second] = -a[j].first;
	return t;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 336 KB Output is correct
5 Correct 6 ms 384 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 6 ms 256 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 336 KB Output is correct
5 Correct 6 ms 384 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 6 ms 256 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Correct 6 ms 384 KB Output is correct
10 Correct 9 ms 384 KB Output is correct
11 Correct 11 ms 256 KB Output is correct
12 Correct 9 ms 384 KB Output is correct
13 Correct 7 ms 384 KB Output is correct
14 Correct 12 ms 384 KB Output is correct
15 Correct 10 ms 384 KB Output is correct
16 Correct 9 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 336 KB Output is correct
5 Correct 6 ms 384 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 6 ms 256 KB Output is correct
8 Correct 5 ms 256 KB Output is correct
9 Correct 6 ms 384 KB Output is correct
10 Correct 9 ms 384 KB Output is correct
11 Correct 11 ms 256 KB Output is correct
12 Correct 9 ms 384 KB Output is correct
13 Correct 7 ms 384 KB Output is correct
14 Correct 12 ms 384 KB Output is correct
15 Correct 10 ms 384 KB Output is correct
16 Correct 9 ms 384 KB Output is correct
17 Correct 15 ms 384 KB Output is correct
18 Incorrect 56 ms 384 KB Output isn't correct
19 Halted 0 ms 0 KB -