Submission #370401

# Submission time Handle Problem Language Result Execution time Memory
370401 2021-02-24T01:40:49 Z daniel920712 "The Lyuboyn" code (IZhO19_lyuboyn) C++14
11 / 100
254 ms 6888 KB
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <stack>

using namespace std;
stack < int > t;
vector < int > all;
char tt[100005];
int N,K,T,S;
void F(int here)
{
    int i,j;
    if(here==0)
    {
        all.push_back(0);
        all.push_back(1);
    }
    else if(here==N)
    {
        printf("%d\n",1<<N);
        for(auto i:all)
        {
            for(j=N-1;j>=0;j--)
            {
                if(i&(1<<j)) printf("1");
                else printf("0");
            }
            printf("\n");
        }
        return;
    }
    else
    {
        for(auto i:all) t.push(i+(1<<here));
        while(!t.empty())
        {
            all.push_back(t.top());
            t.pop();
        }

    }
    F(here+1);
}
int main()
{

    scanf("%d %d %d",&N,&K,&T);
    scanf("%s",tt);
    F(0);
    return 0;
}

Compilation message

lyuboyn.cpp: In function 'void F(int)':
lyuboyn.cpp:14:9: warning: unused variable 'i' [-Wunused-variable]
   14 |     int i,j;
      |         ^
lyuboyn.cpp: In function 'int main()':
lyuboyn.cpp:49:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   49 |     scanf("%d %d %d",&N,&K,&T);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~
lyuboyn.cpp:50:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   50 |     scanf("%s",tt);
      |     ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB First number in answer is not x 1 0
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Fail, not exactly k bits are different: line = 0
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 492 KB Found solution while it does not exist
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 254 ms 6888 KB Ok
2 Correct 108 ms 3428 KB Ok
3 Correct 1 ms 364 KB Ok
4 Correct 1 ms 364 KB Ok
5 Correct 1 ms 364 KB Ok
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Fail, not exactly k bits are different: line = 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 245 ms 6880 KB First number in answer is not x 44202 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 254 ms 6888 KB Ok
2 Correct 108 ms 3428 KB Ok
3 Correct 1 ms 364 KB Ok
4 Correct 1 ms 364 KB Ok
5 Correct 1 ms 364 KB Ok
6 Incorrect 1 ms 364 KB Fail, not exactly k bits are different: line = 0
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 107 ms 3428 KB First number in answer is not x 92826 0
2 Halted 0 ms 0 KB -