제출 #1135266

#제출 시각아이디문제언어결과실행 시간메모리
1135266hamzabc"The Lyuboyn" code (IZhO19_lyuboyn)C++20
3 / 100
129 ms8336 KiB
#include <bits/stdc++.h>
 
 
using namespace std;
 
 
#define all(x) x.begin(), x.end()
#define mod 1000000007
#define sp << " " <<
#define endl << '\n'


long long int N, K, T;
vector<long long int> out;


long long int shifter(int n){
	long long int temp = (1 << n) * ((1 << K) - 1);
	return temp % (1 << N) + temp / (1 << N);
}


void dp(long long int say, int n=0, bool mirored=false){
	if (n == N){
		out.push_back(say);
		return;
	}
	if (mirored){
		dp(say ^ shifter(n), n + 1, false);
		dp(say, n + 1, true);
	}else{
		dp(say, n + 1, false);
		dp(say ^ shifter(n), n + 1, true);
	}
}


signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> N >> K >> T;
	long long int S = 0;
	for (int i = 0; i < N; i++){
		char k;
		cin >> k;
		S += (k == '1') * (1 << i);
	}
	dp(S);
	vector<int> table(1 << N);
	for (int i : out){
		if (table[i]){
			cout << -1;
			return 0;
		}
		table[i]++;
	}
	for (int i : out){
		for (int o = 0; o < N; o++){
			if (i & (1 << o)){
				cout << 1;
			}else{
				cout << 0;
			}
		}
		cout endl;
	}
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...