Submission #355514

# Submission time Handle Problem Language Result Execution time Memory
355514 2021-01-22T15:40:43 Z kshitij_sodani "The Lyuboyn" code (IZhO19_lyuboyn) C++14
0 / 100
930 ms 59620 KB
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first 
#define b second
#define endl '\n'
int n,k,t;
vector<vector<int>> solve(int n){
	if(n==2){
		return {{0,0},{0,1},{1,1},{1,0}};
	}
	else{
		vector<vector<int>> aa=solve(n-1);
		vector<vector<int>> bb=solve(n-1);
		for(int i=0;i<aa.size();i++){
			aa[i].pb(0);
			bb[i].pb(1);
		}
		for(int i=0;i<bb.size();i++){
			aa.pb(bb[i]);
		}
		return aa;
	}
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin>>n>>k>>t;
	if(k==1){
		vector<vector<int>> ans=solve(n);
		cout<<ans.size()<<endl;
		for(auto j:ans){
			for(auto i:j){
				cout<<i;
			}
			cout<<endl;
		}
	}
	
 
	return 0;
}

Compilation message

lyuboyn.cpp: In function 'std::vector<std::vector<int> > solve(int)':
lyuboyn.cpp:18:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |   for(int i=0;i<aa.size();i++){
      |               ~^~~~~~~~~~
lyuboyn.cpp:22:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |   for(int i=0;i<bb.size();i++){
      |               ~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB First number in answer is not x 1 0
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Unexpected end of file - int32 expected
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 930 ms 59620 KB Fail, not exactly k bits are different: line = 3
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 930 ms 59620 KB Fail, not exactly k bits are different: line = 3
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -