Submission #218779

#TimeUsernameProblemLanguageResultExecution timeMemory
218779Lawliet"The Lyuboyn" code (IZhO19_lyuboyn)C++14
5 / 100
609 ms30236 KiB
#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 (stderr)

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++)
                  ~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...