답안 #216706

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
216706 2020-03-27T20:53:29 Z MODDI Rack (eJOI19_rack) C++14
40 / 100
5 ms 384 KB
#include <bits/stdc++.h>
using namespace std;
int MOD= 1e9 + 7;
int main()
{
	int n, k;
	cin>>n>>k;
	vector<int> pow_two;
	pow_two.push_back(1%MOD);
	int at=1;
	for(int i=1;i<n;i++)
	{
		at*=2;
		at %= MOD;
		pow_two.push_back(at);
	}
	int rez=1;
	int step=1;
	while(k!=1)
	{
		if(k%2==0)
		{
			rez+=pow_two[n-step];
			k-=k/2;
			step++;
		}
		else {
			step++;
			k-=k/2;
		}
	}
	cout<<rez<<endl;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 4 ms 256 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 4 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 4 ms 256 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 4 ms 256 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 4 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 4 ms 256 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 4 ms 256 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 384 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 4 ms 256 KB Output is correct
11 Incorrect 5 ms 256 KB Output isn't correct
12 Halted 0 ms 0 KB -