Submission #916391

# Submission time Handle Problem Language Result Execution time Memory
916391 2024-01-25T19:30:41 Z Jakub_Wozniak Permutation (APIO22_perm) C++17
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>
using namespace std;
vector<int> construct_permutation(long long n)
{
    long long akt = 200;
    bool b = 0;
    vector <int> v;
    while (n)
    {
        if (n == 1)
            break;
        if (n % 2)
        {
            v.push_back(0);
        }
        v.push_back(akt);
        n /= 2;
        akt--;
    }

    return v;
}

Compilation message

perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:6:10: warning: unused variable 'b' [-Wunused-variable]
    6 |     bool b = 0;
      |          ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Integer 200 violates the range [0, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Integer 200 violates the range [0, 1]
2 Halted 0 ms 0 KB -