//
// main.cpp
// 2016_messy
//
// Created by Ema Skottova on 12.06.19.
// Copyright © 2019 Ema Skottova. All rights reserved.
//
#include <vector>
#include "messy.h"
using namespace std;
std::vector<int> restore_permutation(int n, int w, int r) {
string s(n, '0');
for(int i = 0; i < n - 1; i ++){
s[n - i - 1] = '1';
add_element(s);
}
compile_set();
int n2 = 1;
for(int i = 0; i < n; i ++){
n2 *= 2;
}
vector<int> a(n, 0);
//vector<string> b(n2);
for(int i = 1; i < n2; i ++){
int y = i;
string x(n, '0');
for(int j = 0; j < n; j ++){
if(y % 2 == 1){
x[j] = '1';
}
y /= 2;
}/*
cout << "check " << x << '\n';
cin >> b[i];
if(b[i] == "true"){*/
if(check_element(x)){
y = i;
for(int j = 0; j < n; j ++){
a[j] += y % 2;
y /= 2;
}
}
}
return a;
}
/*
int main(){
int n, w, r;
cin >> n >> w >> r;
vector<int> a = restore_permutation(n, w, r);
for(int i = 0; i < n; i ++){
cout << a[i] << " ";
}
cout << '\n';
}
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
384 KB |
n = 8 |
2 |
Correct |
2 ms |
256 KB |
n = 8 |
3 |
Correct |
2 ms |
256 KB |
n = 8 |
4 |
Correct |
2 ms |
256 KB |
n = 8 |
5 |
Correct |
2 ms |
384 KB |
n = 8 |
6 |
Correct |
2 ms |
384 KB |
n = 8 |
7 |
Correct |
2 ms |
256 KB |
n = 8 |
8 |
Correct |
2 ms |
256 KB |
n = 8 |
9 |
Correct |
2 ms |
384 KB |
n = 8 |
10 |
Correct |
2 ms |
384 KB |
n = 8 |
11 |
Correct |
2 ms |
384 KB |
n = 8 |
12 |
Correct |
2 ms |
384 KB |
n = 8 |
13 |
Correct |
2 ms |
384 KB |
n = 8 |
14 |
Correct |
2 ms |
256 KB |
n = 8 |
15 |
Correct |
2 ms |
384 KB |
n = 8 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
grader returned WA |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
grader returned WA |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
grader returned WA |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
grader returned WA |
2 |
Halted |
0 ms |
0 KB |
- |