답안 #218779

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
218779 2020-04-02T17:44:23 Z Lawliet "The Lyuboyn" code (IZhO19_lyuboyn) C++14
5 / 100
609 ms 30236 KB
#include <bits/stdc++.h>

using namespace std;

int n, k, t;

int main()
{
	string s;
	cin >> n >> k >> t >> s;

	vector< string > ans;

	ans.push_back( "0" );
	ans.push_back( "1" );

	for(int i = 2 ; i <= n ; i++)
	{
		vector< string > aux = ans;

		for(int j = 0 ; j < ans.size() ; j++)
			ans[j].push_back( '0' );

		for(int j = 0 ; j < ans.size() ; j++)
			aux[j].push_back( '1' );

		for(int j = aux.size() - 1 ; j >= 0 ; j--)
			ans.push_back( aux[j] );
	}

	cout << ans.size() << endl;

	for(int i = 0 ; i < ans.size() ; i++)
	{
		if( i%2 == 1 )
		{
			for(int j = 0 ; j < n ; j++)
				ans[i][j] = '0' + '1' - ans[i][j];
		}
		
		cout << ans[i] << endl;
	}
}

Compilation message

lyuboyn.cpp: In function 'int main()':
lyuboyn.cpp:21:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j = 0 ; j < ans.size() ; j++)
                   ~~^~~~~~~~~~~~
lyuboyn.cpp:24:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j = 0 ; j < ans.size() ; j++)
                   ~~^~~~~~~~~~~~
lyuboyn.cpp:33:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0 ; i < ans.size() ; i++)
                  ~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 256 KB First number in answer is not x 1 0
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 256 KB Ok
# 결과 실행 시간 메모리 Grader output
1 Incorrect 21 ms 768 KB Found solution while it does not exist
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 590 ms 30236 KB Fail, not exactly k bits are different: line = 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 256 KB The values in the output sequence are not pairwise distinct!
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 609 ms 30036 KB First number in answer is not x 44202 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 590 ms 30236 KB Fail, not exactly k bits are different: line = 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 313 ms 15116 KB The values in the output sequence are not pairwise distinct!
2 Halted 0 ms 0 KB -