제출 #155684

#제출 시각아이디문제언어결과실행 시간메모리
155684qkxwsm"The Lyuboyn" code (IZhO19_lyuboyn)C++14
16 / 100
239 ms6412 KiB
#include <bits/stdc++.h>

using namespace std;

template<class T, class U>
void ckmin(T &a, U b)
{
	if (a > b) a = b;
}
template<class T, class U>
void ckmax(T &a, U b)
{
	if (a < b) a = b;
}

#define MP make_pair
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--)
#define SZ(x) ((int) ((x).size()))
#define ALL(x) (x).begin(), (x).end()
#define MAXN 300013

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

int N, K;
bool T;
int st;
int ans[MAXN];
int arr[MAXN];


int32_t main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> N >> K >> T;
	string temps; cin >> temps;
	reverse(ALL(temps));
	while(SZ(temps) < N)
	{
		temps += '0';
	}
	reverse(ALL(temps));
	FOR(i, 0, N)
	{
		st *= 2; st += (temps[i] == '1');
	}
	arr[0] = (1 << K) - 1;
	FOR(i, 1, N)
	{
		arr[i] = ((arr[i - 1] << 1) | (arr[i - 1] >> (N - 1))) & ((1 << N) - 1);
	}
	FOR(i, 1, (1 << N))
	{
		ans[i] = __builtin_ctz(i);
	}
	FOR(i, 1, (1 << N))
	{
		ans[i] = arr[ans[i]];
	}
	// FOR(i, 0, N)
	// {
	// 	cerr << arr[i] << ' ';
	// }
	// cerr << endl;
	ans[0] = st;
	FOR(i, 1, (1 << N))
	{
		ans[i] ^= ans[i - 1];
	}
	cout << (1 << N) << '\n';
	FOR(i, 0, (1 << N))
	{
		FORD(j, N, 0)
		{
			cout << ((ans[i] & (1 << j)) ? 1 : 0);
		}
		cout << '\n';
	}
	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...