답안 #1090907

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1090907 2024-09-19T06:27:48 Z Muhammet Rack (eJOI19_rack) C++17
100 / 100
100 ms 604 KB
#include <bits/stdc++.h>

using namespace std;

const long long M = (1e9 + 7);

long long n, k, ans;

void f(long long x, long long l, int y){
	if(y == -1){
		ans = l;
		return;
	}
	if(x % 2 == 0){
		long long z = 1;
		for(int i = 0; i < y; i++){
			z *= 2;
			z %= M;
		}
		l += z;
		l %= M;
	}
	if(x >= 2) x++, x /= 2;
	f(x,l,y-1);
}

int main(){
	cin >> n >> k;
	f(k,1,n-1);
	ans %= M;
	cout << ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 352 KB Output is correct
4 Correct 0 ms 352 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 352 KB Output is correct
4 Correct 0 ms 352 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 352 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 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 352 KB Output is correct
4 Correct 0 ms 352 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 352 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 604 KB Output is correct
14 Correct 8 ms 344 KB Output is correct
15 Correct 100 ms 352 KB Output is correct