이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |