Submission #289504

# Submission time Handle Problem Language Result Execution time Memory
289504 2020-09-02T17:23:11 Z wdjpng Rack (eJOI19_rack) C++17
40 / 100
1 ms 384 KB
#include <bits/stdc++.h>    

#define rep(i, n, a) for (int i = a; i < n; i++)
#define lint long long
using namespace std;

const int MOD = 1e9+7;
signed main()
{
    int n, k;
    cin >> n >> k;

    int res=0;
    vector<int>bits(n);
    bits[0]=1;
    
    rep(i, n, 1){
        bits[i]=bits[i-1]*2;
        bits[i]%=MOD;
    }

    k--;
    rep(i, n, 0){
        if((k>>i)&1){
            res+=bits[n-i-1];
            res%=MOD;
        }
    }

    cout << res + 1;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 0 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 0 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Incorrect 0 ms 256 KB Output isn't correct
12 Halted 0 ms 0 KB -