Submission #251911

#TimeUsernameProblemLanguageResultExecution timeMemory
251911lycOn the Grid (FXCUP4_grid)C++17
12 / 100
2 ms384 KiB
#include "grid.h"
#include <bits/stdc++.h>
using namespace std;

#define TRACE(x) cerr << #x << " :: " << x << endl;
#define _ << " " <<
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(a);i>=(b);--i)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
using ll=long long;

std::vector<int> SortDisks(int N) {
	vector<int> v(N);
	iota(ALL(v),0);
	srand(3812094);
	RFOR(i,N-1,1){
		random_shuffle(v.begin(),v.begin()+i+1);
		RFOR(j,i,0){
			swap(v[j],v[0]);
			int X = PutDisks(v);
			swap(v[j],v[0]);
			//for (int a : v){ cout << a << ' '; } cout << " :: " << X << endl;
			if (X == (i+1)+(N-1)) {
				swap(v[j],v[i]);
				break;
			}
		}
	}
	vector<int> ans(N);
	FOR(i,0,N-1){
		ans[v[i]] = i+1;
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...