답안 #919270

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
919270 2024-01-31T13:55:05 Z raphaelp Rack (eJOI19_rack) C++14
40 / 100
0 ms 600 KB
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long N, K;
    cin >> N >> K;
    K--;
    long long x = 1;
    long long MOD = 1000000007;
    vector<long long> power(N);
    long long base = 1;
    for (long long i = 0; i < N; i++)
    {
        power[i] = base;
        base *= 2;
        base = base % MOD;
    }
    for (long long i = 0; i < N; i++)
    {
        if (K & (1 << i))
        {
            x = (x + power[N - i - 1]) % MOD;
        }
    }
    cout << x;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 600 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 600 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 600 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Incorrect 0 ms 344 KB Output isn't correct
12 Halted 0 ms 0 KB -