Submission #672150

# Submission time Handle Problem Language Result Execution time Memory
672150 2022-12-14T20:47:14 Z Stavab Rack (eJOI19_rack) C++14
40 / 100
1 ms 300 KB
#include <iostream>

using namespace std;

int pow(int n)
{
    long long t = 1;
    for(int i = 1; i <= n; i++)
    {
        t *= 2;
        t %= 1000000007;
    }
    return t;
}

int main()
{
    int n, k;
    cin >> n >> k;
    
    k = k - 1;
    long long ans = 0;
    for(int i = 1; i <= n; i++)
    {
        if(k % 2 == 1)
        {
            ans += pow(n - i);
            ans %= 1000000007;
        }
        
        k /= 2;
    }
    
    ans = ans + 1;
    ans %= 1000000007;
    
    cout << ans << '\n';
    
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 296 KB Output is correct
3 Correct 1 ms 300 KB Output is correct
4 Correct 1 ms 296 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 296 KB Output is correct
3 Correct 1 ms 300 KB Output is correct
4 Correct 1 ms 296 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 296 KB Output is correct
3 Correct 1 ms 300 KB Output is correct
4 Correct 1 ms 296 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Incorrect 1 ms 212 KB Output isn't correct
13 Halted 0 ms 0 KB -