| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1179295 | vladkonoval | Rack (eJOI19_rack) | C++20 | 1 ms | 1936 KiB |
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
using ll = long long;
ll n,k,a[1000007],res,i;
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n>>k;
if (k==1){cout<<1;return 0;}
a[1] = 1;
res = (1<<(n-1))%1000000007;
for (i=2;i<=(1<<n);i++) {
if (i%2==0) a[i] = a[i-1]+res;
else {
a[i%1000000007] = (a[(i-1)/2+1]+1)/2;
}
a[i%1000000007]%=1000000007;
if (a[i%1000000007]==k) {cout<<i;return 0;}
}
return 0;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
