Submission #148475

# Submission time Handle Problem Language Result Execution time Memory
148475 2019-09-01T04:30:09 Z 잉여로운 고3(#3749, imyujin, sebinkim) On the Grid (FXCUP4_grid) C++17
0 / 100
6 ms 384 KB
#include "grid.h"
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 1005;

vector<int> ans, ans2;
bool chk[MAXN];

std::vector<int> SortDisks(int N) {
	ans.resize(N);
	for(int i = 0; i < N; i++) {
		vector<int> v;
		for(int j = 0; j < N; j++) if(!chk[j]) v.push_back(j);
		for(int j = N - i; j < N; j++) v.push_back(ans[j]);
		int X = PutDisks(v);
		int t = X - (N - i);
		ans[N - i - 1] = v[N - 1 - t];
		chk[v[N - 1 - t]] = true;
	}
	ans2.resize(N);
	for(int i = 0; i < N; i++) ans2[ans[i]] = i + 1;
	return ans2;
}
# 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 Incorrect 6 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 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 Incorrect 6 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 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 Incorrect 6 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -