Submission #336460

# Submission time Handle Problem Language Result Execution time Memory
336460 2020-12-15T11:06:11 Z beksultan04 "The Lyuboyn" code (IZhO19_lyuboyn) C++14
0 / 100
294 ms 7644 KB
#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],p[N],dp[N];
main(){
    int n,k,t,i,j;
    scan3(n,k,t)
    string s;
    cin>>s;
    vector <int> v;
    v.pb(0);
    v.pb(1);
    for (i=1;i<n;++i){
        int x = (1<<i);
        for (j=v.size()-1;j>=0;--j){
            v.pb(x+v[j]);
        }
    }
    for (i=0;i<v.size();++i){
        for (j=0;j<n;++j){
            if (v[i]&(1<<j)){
                cout << 1;
            }
            else cout<<0;
        }endi
    }

}






Compilation message

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:32:15: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |     for (i=0;i<v.size();++i){
      |              ~^~~~~~~~~
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 time Memory Grader output
1 Incorrect 0 ms 364 KB Expected integer, but "00" found
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Expected integer, but "0000" found
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 492 KB Expected integer, but "0000000000000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 282 ms 7644 KB Expected integer, but "000000000000000000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Expected integer, but "0000000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 294 ms 7516 KB Expected integer, but "000000000000000000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 282 ms 7644 KB Expected integer, but "000000000000000000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 156 ms 3808 KB Expected integer, but "00000000000000000" found
2 Halted 0 ms 0 KB -