답안 #150276

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
150276 2019-09-01T08:02:41 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;
	}
	for (i = 0; i < 2000; i++) {
		for (j = 0; j < N; j++) t[j] = a[j].second;
		k = PutDisks(t);
		l = 0;
		for (j = 0; j < N; 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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 256 KB Output is correct
5 Correct 6 ms 256 KB Output is correct
6 Correct 6 ms 256 KB Output is correct
7 Correct 7 ms 256 KB Output is correct
8 Correct 6 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 256 KB Output is correct
5 Correct 6 ms 256 KB Output is correct
6 Correct 6 ms 256 KB Output is correct
7 Correct 7 ms 256 KB Output is correct
8 Correct 6 ms 256 KB Output is correct
9 Correct 8 ms 256 KB Output is correct
10 Correct 12 ms 384 KB Output is correct
11 Correct 15 ms 384 KB Output is correct
12 Correct 12 ms 384 KB Output is correct
13 Correct 10 ms 384 KB Output is correct
14 Correct 12 ms 384 KB Output is correct
15 Correct 12 ms 256 KB Output is correct
16 Correct 12 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 256 KB Output is correct
5 Correct 6 ms 256 KB Output is correct
6 Correct 6 ms 256 KB Output is correct
7 Correct 7 ms 256 KB Output is correct
8 Correct 6 ms 256 KB Output is correct
9 Correct 8 ms 256 KB Output is correct
10 Correct 12 ms 384 KB Output is correct
11 Correct 15 ms 384 KB Output is correct
12 Correct 12 ms 384 KB Output is correct
13 Correct 10 ms 384 KB Output is correct
14 Correct 12 ms 384 KB Output is correct
15 Correct 12 ms 256 KB Output is correct
16 Correct 12 ms 384 KB Output is correct
17 Correct 18 ms 384 KB Output is correct
18 Incorrect 56 ms 384 KB Output isn't correct
19 Halted 0 ms 0 KB -