Submission #155684

# Submission time Handle Problem Language Result Execution time Memory
155684 2019-09-29T19:27:20 Z qkxwsm "The Lyuboyn" code (IZhO19_lyuboyn) C++14
16 / 100
239 ms 6412 KB
#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 time Memory Grader output
1 Correct 2 ms 376 KB Ok
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Ok
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 504 KB Found solution while it does not exist
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 237 ms 6392 KB Ok
2 Correct 110 ms 3320 KB Ok
3 Correct 3 ms 376 KB Ok
4 Correct 2 ms 376 KB Ok
5 Correct 2 ms 376 KB Ok
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Ok
2 Correct 7 ms 504 KB Ok
3 Correct 110 ms 3196 KB Ok
4 Correct 53 ms 1784 KB Ok
5 Incorrect 2 ms 376 KB The values in the output sequence are not pairwise distinct!
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 232 ms 6348 KB Ok
2 Correct 237 ms 6340 KB Ok
3 Incorrect 231 ms 6392 KB The values in the output sequence are not pairwise distinct!
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 237 ms 6392 KB Ok
2 Correct 110 ms 3320 KB Ok
3 Correct 3 ms 376 KB Ok
4 Correct 2 ms 376 KB Ok
5 Correct 2 ms 376 KB Ok
6 Correct 2 ms 376 KB Ok
7 Correct 7 ms 504 KB Ok
8 Correct 110 ms 3196 KB Ok
9 Correct 53 ms 1784 KB Ok
10 Incorrect 2 ms 376 KB The values in the output sequence are not pairwise distinct!
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 117 ms 3188 KB Ok
2 Correct 239 ms 6412 KB Ok
3 Correct 235 ms 6392 KB Ok
4 Correct 14 ms 632 KB Ok
5 Correct 2 ms 376 KB Ok
6 Correct 27 ms 1016 KB Ok
7 Correct 231 ms 6392 KB Ok
8 Incorrect 3 ms 376 KB The values in the output sequence are not pairwise distinct!
9 Halted 0 ms 0 KB -