Submission #498824

#TimeUsernameProblemLanguageResultExecution timeMemory
498824nickmet2004"The Lyuboyn" code (IZhO19_lyuboyn)C++11
20 / 100
372 ms22756 KiB
#include<bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int n , k , T , M; string s; int vis[N]; vector<int> ans,v; void go(int x){ if(M==0)return; --M; vis[x]=1; ans.emplace_back(x); for(int y : v){ if(!vis[x^y])go(x^y); } } main (){ ios_base::sync_with_stdio(0); cin.tie(0); cin >> n>>k>>T>>s; for(int i= 0; i < (1<<n); ++i){ if(__builtin_popcount(i)==k){ v.emplace_back(i); } } int X= 0; for(int i = 0; i< s.size(); ++i){ if(s[i]=='1')X+=(1<<(s.size()-i-1)); } // for(int x : v)cout <<x<<endl; M = (1<<n); go(X); cout<<(1<<n)<<endl; for(int i = 0; i < ans.size();++i){ for(int j = n-1; ~j; --j)cout << (ans[i]>>j&1);cout<<endl; } }

Compilation message (stderr)

lyuboyn.cpp:17:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   17 |  main (){
      |  ^~~~
lyuboyn.cpp: In function 'int main()':
lyuboyn.cpp:26:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |     for(int i = 0; i< s.size(); ++i){
      |                    ~^~~~~~~~~~
lyuboyn.cpp:33:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |     for(int i = 0; i < ans.size();++i){
      |                    ~~^~~~~~~~~~~~
lyuboyn.cpp:34:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   34 |         for(int j = n-1; ~j; --j)cout << (ans[i]>>j&1);cout<<endl;
      |         ^~~
lyuboyn.cpp:34:56: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   34 |         for(int j = n-1; ~j; --j)cout << (ans[i]>>j&1);cout<<endl;
      |                                                        ^~~~
#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...