Submission #336380

#TimeUsernameProblemLanguageResultExecution timeMemory
336380beksultan04"The Lyuboyn" code (IZhO19_lyuboyn)C++14
3 / 100
54 ms10312 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define OK puts("OK"); #define fr first #define sc second #define ret return #define scan1(a) scanf("%lld",&a); #define scan2(a,b) scanf("%lld %lld",&a, &b); #define scan3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c); #define all(s) s.begin(),s.end() #define pb push_back #define sz(v) (int)v.size() #define endi puts(""); const int N = 5e5+12,INF=1e9+7; int q[N]; main(){ int n,k,t,i,j; scan3(n,k,t) if (k%2==0){ cout <<-1; ret 0; } vector <string> v; for (i=0;i<(1<<n);++i){ string s=""; for (j=0;n>=(1<<j);++j){ if (i&(1<<j))s+='1'; else s+='0'; } v.pb(s); } cout <<v.size()<<"\n"; for (i=0;i<v.size()/2;++i)cout <<v[i]<<"\n"; for (i=v.size()-1;i>=v.size()/2;--i)cout <<v[i]<<"\n"; }

Compilation message (stderr)

lyuboyn.cpp:18:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   18 | main(){
      |      ^
lyuboyn.cpp: In function 'int main()':
lyuboyn.cpp:35:15: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |     for (i=0;i<v.size()/2;++i)cout <<v[i]<<"\n";
      |              ~^~~~~~~~~~~
lyuboyn.cpp:36:24: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |     for (i=v.size()-1;i>=v.size()/2;--i)cout <<v[i]<<"\n";
      |                       ~^~~~~~~~~~~~
lyuboyn.cpp:11:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   11 | #define scan3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c);
      |                      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
lyuboyn.cpp:20:5: note: in expansion of macro 'scan3'
   20 |     scan3(n,k,t)
      |     ^~~~~
#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...