# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
257695 | BThero | "The Lyuboyn" code (IZhO19_lyuboyn) | C++17 | 429 ms | 6488 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// chrono::system_clock::now().time_since_epoch().count()
#include<bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << " = " << x << endl;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
vi gen(int n, int k) {
if (k % 2 == 0) {
return {};
}
vi ret;
if (k == 1) {
if (n == 1) {
return vi({0, 1});
}
vi A = gen(n - 1, k);
vi B = A;
reverse(all(B));
for (int &x : B) {
x += (1 << (n - 1));
}
for (int x : A) {
ret.pb(x);
}
for (int x : B) {
ret.pb(x);
}
return ret;
}
return ret;
}
void solve() {
int n, k, T;
string S;
scanf("%d %d %d", &n, &k, &T);
cin >> S;
int st = 0;
for (int i = 0; i < n; ++i) {
if (S[i] == '1') {
st += (1 << i);
}
}
vi vec = gen(n, k);
if (vec.empty()) {
printf("-1\n");
return;
}
rotate(vec.begin(), find(all(vec), st), vec.end());
printf("%d\n", (1 << n));
for (int x : vec) {
for (int i = 0; i < n; ++i) {
printf("%d", (x >> i) & 1);
}
printf("\n");
}
}
int main() {
int tt = 1;
while (tt--) {
solve();
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |