Submission #150142

# Submission time Handle Problem Language Result Execution time Memory
150142 2019-09-01T07:47:46 Z Ian and 2-bit memory(#3648, percywtc, nhho, ulna) On the Grid (FXCUP4_grid) C++17
0 / 100
6 ms 384 KB
#include <bits/stdc++.h>

using namespace std;

#include "grid.h"

vector<int> SortDisks(int N) {
	srand(689);
	vector<int> ans(N), inv(N);
	set<int> left;
	for (int i = 0; i < N; i++)
		left.insert(i);
	for (int i = N - 1; i >= 0; i--) {
		map<int, int> m;
		for (int k = 0; k < 10; k++) {
			vector<int> vv(left.begin(), left.end());
			random_shuffle(vv.begin(), vv.end());
			vector<int> test(inv);
			for (int j = 0; j <= i; j++)
				test[j] = vv[j];
			// for (int j : test) printf("%d ", j); puts("");
			int tmp = PutDisks(test) - N;
			m[tmp] = test[i - tmp];
		}
		int tmp = m.begin()->second;
		// printf("i=%d tmp=%d\n", i, tmp);
		left.erase(tmp);
		ans[tmp] = i + 1;
		inv[i] = tmp;
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 6 ms 256 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 6 ms 384 KB Output is correct
2 Correct 6 ms 256 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 6 ms 384 KB Output is correct
2 Incorrect 6 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
4 Correct 6 ms 256 KB Output is correct