Submission #530390

# Submission time Handle Problem Language Result Execution time Memory
530390 2022-02-25T09:26:38 Z Piokemon Rack (eJOI19_rack) C++17
100 / 100
9 ms 316 KB
#include <bits/stdc++.h>
using namespace std;

long long int const m = 1000000007;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long int n,k,odp,pot;
    cin >> n >> k;
    odp = 1;
    k -= 1;
    for (int x=0;x<n;x++){
        odp = (odp*2 + (k%2)) % m;
        k = k/2;
    }
    pot = 1;
    for (int x=0;x<n;x++){
        pot = (pot*2) % m;
    }
    cout << (odp - pot + 1 + m) % m<< "\n";
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 1 ms 312 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 312 KB Output is correct
15 Correct 9 ms 316 KB Output is correct