# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
218814 | Lawliet | "The Lyuboyn" code (IZhO19_lyuboyn) | C++14 | 189 ms | 6120 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int n, k, t;
void printBinary(int k)
{
for(int i = n - 1 ; i >= 0 ; i--)
{
if( k & (1 << i) ) printf("1");
else printf("0");
}
printf("\n");
}
int main()
{
string s;
cin >> n >> k >> t >> s;
vector< int > ans;
ans.push_back( 0 );
ans.push_back( 1 );
for(int i = 2 ; i <= 4 ; i++)
{
int curSz = ans.size();
for(int j = 0 ; j < ans.size() ; j++)
ans[j] = 2*ans[j];
for(int j = curSz - 1 ; j >= 0 ; j--)
ans.push_back( ans[j] + 1 );
}
for(int i = 1 ; i < ans.size() ; i += 2)
ans[i] = 15 - ans[i];
for(int i = 5 ; i <= n ; i++)
{
int curSz = ans.size();
int first = ans.back();
for(int j = 0 ; j < k - 1 ; j++)
first ^= (1 << j);
int indFirst;
for(int j = 0 ; j < ans.size() ; j++)
if( ans[j] == first ) indFirst = j;
for(int j = 0 ; j < ans.size() ; j++)
ans[j] = 2*ans[j];
int lim = indFirst - 1;
if( lim == -1 ) lim = curSz - 1;
for(int j = indFirst ; j != lim ; j++, j %= curSz)
ans.push_back( ans[j] + 1 );
}
printf("%d\n",(int) ans.size());
for(int i = 0 ; i < ans.size() ; i++)
printBinary( ans[i] );
}
컴파일 시 표준 에러 (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... |