#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <cstdlib>
#include <iostream>
#include "messy.h"
#include <numeric>
#include <algorithm>
#include <random>
#include <chrono>
using namespace std;
vector<int> restore_permutation(int N, int W, int R){
string s = string(N, '0');
for(int i = 0; i < N; i ++){
s[i] = '1';
add_element(s);
}
vector<int> order(N);
iota(order.begin(), order.end(), 0);
compile_set();
string ans = string(N, '0');
vector<int> perm(N);
shuffle(order.begin(), order.end(), mt19937(97));
for(int i = 0; i < N; i ++){
for(int j : order){
string temp = ans;
if(ans[j] == '0'){
temp[j] = '1';
bool good = check_element(temp);
if(good){
ans[j] = '1';
perm[j] = i;
break;
}
}
}
}
return perm;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
n = 8 |
2 |
Correct |
0 ms |
212 KB |
n = 8 |
3 |
Correct |
0 ms |
212 KB |
n = 8 |
4 |
Correct |
1 ms |
212 KB |
n = 8 |
5 |
Correct |
0 ms |
212 KB |
n = 8 |
6 |
Correct |
1 ms |
276 KB |
n = 8 |
7 |
Correct |
0 ms |
212 KB |
n = 8 |
8 |
Correct |
0 ms |
212 KB |
n = 8 |
9 |
Correct |
0 ms |
212 KB |
n = 8 |
10 |
Correct |
0 ms |
212 KB |
n = 8 |
11 |
Correct |
0 ms |
212 KB |
n = 8 |
12 |
Correct |
0 ms |
212 KB |
n = 8 |
13 |
Correct |
0 ms |
212 KB |
n = 8 |
14 |
Correct |
0 ms |
212 KB |
n = 8 |
15 |
Correct |
0 ms |
212 KB |
n = 8 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
n = 32 |
2 |
Correct |
0 ms |
212 KB |
n = 32 |
3 |
Correct |
0 ms |
212 KB |
n = 32 |
4 |
Correct |
0 ms |
212 KB |
n = 32 |
5 |
Correct |
0 ms |
212 KB |
n = 32 |
6 |
Correct |
0 ms |
212 KB |
n = 32 |
7 |
Correct |
1 ms |
212 KB |
n = 32 |
8 |
Correct |
0 ms |
212 KB |
n = 32 |
9 |
Correct |
1 ms |
212 KB |
n = 32 |
10 |
Correct |
0 ms |
212 KB |
n = 32 |
11 |
Correct |
0 ms |
212 KB |
n = 32 |
12 |
Correct |
0 ms |
212 KB |
n = 32 |
13 |
Correct |
0 ms |
212 KB |
n = 32 |
14 |
Correct |
0 ms |
212 KB |
n = 32 |
15 |
Correct |
0 ms |
212 KB |
n = 32 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
n = 32 |
2 |
Correct |
0 ms |
212 KB |
n = 32 |
3 |
Correct |
0 ms |
212 KB |
n = 32 |
4 |
Correct |
0 ms |
212 KB |
n = 32 |
5 |
Correct |
0 ms |
212 KB |
n = 32 |
6 |
Correct |
0 ms |
212 KB |
n = 32 |
7 |
Correct |
0 ms |
212 KB |
n = 32 |
8 |
Correct |
0 ms |
212 KB |
n = 32 |
9 |
Correct |
0 ms |
212 KB |
n = 32 |
10 |
Correct |
1 ms |
212 KB |
n = 32 |
11 |
Correct |
0 ms |
212 KB |
n = 32 |
12 |
Correct |
0 ms |
212 KB |
n = 32 |
13 |
Correct |
1 ms |
212 KB |
n = 32 |
14 |
Correct |
0 ms |
212 KB |
n = 32 |
15 |
Correct |
0 ms |
212 KB |
n = 32 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
grader returned WA |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
grader returned WA |
2 |
Halted |
0 ms |
0 KB |
- |