Submission #251908

# Submission time Handle Problem Language Result Execution time Memory
251908 2020-07-23T05:40:13 Z oolimry On the Grid (FXCUP4_grid) C++17
12 / 100
4 ms 416 KB
#include "grid.h"
#include <bits/stdc++.h>
using namespace std;

vector<int> SortDisks(int N) {
	deque<int> D;
	for(int i = 0;i < N;i++) D.push_back(i);
	
	deque<int> T;
	int need = 2*N-1;
	while(!D.empty()){
		vector<int> S;
		
		for(int x : D) S.push_back(x);
		for(int x : T) S.push_back(x);
		
		int d = D.front(); D.pop_front();
		
		int res = PutDisks(S);
		//for(int x : S) cout << size[x] << " ";
		//cout << res << "res\n";
		
		if(res == need){
			T.push_front(d);
			need--;
		}
		else{
			D.push_back(d);
		}
	}
	
	vector<int> ans(N);
	for(int i = 0;i < N;i++) ans[T[i]] = i+1;
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 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 384 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 0 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 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 384 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 0 ms 384 KB Output is correct
9 Incorrect 4 ms 416 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 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 384 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 0 ms 384 KB Output is correct
9 Incorrect 4 ms 416 KB Output isn't correct
10 Halted 0 ms 0 KB -