Submission #173623

#TimeUsernameProblemLanguageResultExecution timeMemory
173623RafaelSus"The Lyuboyn" code (IZhO19_lyuboyn)C++14
3 / 100
2 ms412 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; typedef long long ll; const ll inf=1e15; #define pb push_back const int INF=(0x3f3f3f3f); int tod(vector<int>a){ int res=0; reverse(a.begin(),a.end()); for(int i=0;i<a.size();i++){ res+=a[i]*(1<<i); } return res; } string tobin(int x,int h){ string res=""; if(x==0){ res="0"; while(res.size()<h)res+="0"; return res; } while(x){ if(x%2)res+="1"; else res+="0"; x/=2; } while(res.size()<h)res+="0"; reverse(res.begin(),res.end()); return res; } void print(vector<int> a){ for(int i=0;i<a.size();i++)cout<<a[i]<<' '; cout << '\n'; } int main(){ ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); int n,k,t; cin>>n>>k>>t; string s; cin>>s; cout<<"-1\n"; return 0; vector<int> a(n,0); for(int i=0;i<k;i++)a[i]=1; int start=0; vector<int>tv; tv.pb(start); int X=0; set<int>st; st.insert(0); vector<int>b=a; while(tv.size()<(1<<n)){ do{ if(st.find(start^tod(a))!=st.end())continue; tv.pb(start^tod(a)); st.insert(start^tod(a)); start^=tod(a); }while(prev_permutation(a.begin(),a.end())); X++; for(int i=0;i<n;i++)a[i]=0; for(int i=0;i<k;i++)a[i]=1; } for(int i=0;i<(1<<n);i++){ cout<<tobin(tv[i],n)<<'\n'; //cout<<tv[i]<<'\n'; } }

Compilation message (stderr)

lyuboyn.cpp: In function 'int tod(std::vector<int>)':
lyuboyn.cpp:13:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i<a.size();i++){
               ~^~~~~~~~~
lyuboyn.cpp: In function 'std::__cxx11::string tobin(int, int)':
lyuboyn.cpp:23:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(res.size()<h)res+="0";
           ~~~~~~~~~~^~
lyuboyn.cpp:31:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(res.size()<h)res+="0";
         ~~~~~~~~~~^~
lyuboyn.cpp: In function 'void print(std::vector<int>)':
lyuboyn.cpp:37:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i<a.size();i++)cout<<a[i]<<' ';
               ~^~~~~~~~~
lyuboyn.cpp: In function 'int main()':
lyuboyn.cpp:60:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(tv.size()<(1<<n)){
         ~~~~~~~~~^~~~~~~
#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...