Submission #251912

# Submission time Handle Problem Language Result Execution time Memory
251912 2020-07-23T05:54:54 Z errorgorn On the Grid (FXCUP4_grid) C++17
12 / 100
1 ms 256 KB
#include "grid.h"
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ii pair<int,int>
#define iii pair<ii,int>
#define fi first
#define se second
#define endl '\n'

#define rep(x,s,e) for (auto x=s-(s>e);x!=e-(s>e);(s<e?x++:x--))
#define sz(x) (int) (x).size()
#define all(x) (x).begin(),(x).end()

bool used[55];

std::vector<int> SortDisks(int n) {
	vector<int> res;
	
	rep(test,1,n+1){
		rep(x,0,n) if (!used[x]){
			vector<int> temp={x};
			rep(y,0,n){
				if (!used[y] && y!=x) temp.push_back(y);
			}
			for (auto &it:res) temp.push_back(it);
			
			//for (auto &it:temp) cout<<it<<" ";cout<<endl;
			//cout<<PutDisks(temp)<<endl;
			
			if (PutDisks(temp)==n*2-test){
				res.insert(res.begin(),x);
				used[x]=true;
				break;
			}
		}
	}
	
	//for (auto &it:res) cout<<it<<" ";cout<<endl;
	vector<int> ans(n);
	
	rep(x,0,n){
		ans[res[x]]=x+1;
	}
	
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Incorrect 0 ms 256 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Incorrect 0 ms 256 KB Output isn't correct
10 Halted 0 ms 0 KB -