# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
731758 | AtabayRajabli | Rack (eJOI19_rack) | C++11 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define MAX 5e4 + 1
#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define INF 0x3F3F3F3F3F3F3F3FLL
#define OPT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define sec second
#define fi first
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
binpow(ll a, ll b, ll c)
{
}
void $()
{
int n, k, mod = 1e9 + 7;
cin >> n >> k;
k--;
int res = 0;
while(k)
{
n--;
if(k & 1)
{
res = (res + (int)pow(2, n)) % mod;
}
k >>= 1;
}
cout << res + 1 << endl;
}
int main()
{
OPT
int t = 1;
//cin >> t;
while(t--)
$();
}