제출 #731760

#제출 시각아이디문제언어결과실행 시간메모리
731760AtabayRajabliRack (eJOI19_rack)C++11
100 / 100
1 ms320 KiB
#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; ll binpow(ll a, ll b, ll c) { ll res = 1; a%=c; while(b > 0) { if(b & 1) { res = res * a % c; } a = a * a % c; b >>= 1; } return res; } void $() { ll n, k, mod = 1e9 + 7; cin >> n >> k; k--; ll res = 1; while(k) { n--; if(k & 1) { res = (res + binpow(2, n, mod))%mod; } k >>= 1; } cout << res << endl; } int main() { OPT int t = 1; while(t--) $(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...