이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <vector>
#include <bits/stdc++.h>
#define bupol __builtin_popcount
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define lf (id<<1)
#define rg ((id<<1)|1)
#define md ((l+r)>>1)
using namespace std;
const int MAXN = 1e3+5;
const int MAXK = 205;
const int LOG = 20;
const int MOD = 1e9+7;
const int SQRT = 520;
const ll INF = 1e18+10;
typedef pair<int,int> pii;
typedef pair<pii,int> ipii;
#include "messy.h"
int n;
void ADD(){
string s = "";
for(int i=0; i<n; i++) s += '1';
for(int i=0; i<n; i++){
s[i] = '0';
add_element(s);
}
}
pii ans = {-1, -1};
vector <int> vec;
vector<int> restore_permutation(int N, int w, int r) {
n = N;
ADD();
compile_set();
for(int i=0; i<n-1; i++){
string s = "";
for(int j=0; j<=i; j++) s += '0';
for(int j=i+1; j<n; j++) s += '1';
for(int j=0; j<=i; j++){
swap(s[j], s[i+1]);
if(check_element(s)){
ans = pii(j, i+1);
}
swap(s[j], s[i+1]);
}
}
for(int i=0; i<n; i++) vec.pb(i);
swap(vec[ans.fi], vec[ans.se]);
return vec;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |