제출 #1268142

#제출 시각아이디문제언어결과실행 시간메모리
1268142haithamcoderRack (eJOI19_rack)C++20
40 / 100
0 ms332 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; const int MOD = 1000000007; const ll LOG = 31; #define db(x) cerr << #x << " = " << x << " | " #define dbg(x) cerr << #x << " = " << x << "\n" #define Algerian ios::sync_with_stdio(0); #define OI cin.tie(NULL); ll binexp(ll b, ll e) { ll res = 1; while (e > 0) { if (e & 1) res = (res * b) % MOD; e >>= 1; b = (b * b) % MOD; } return res; } int main() { Algerian OI ll n, k; cin >> n >> k; --k; ll res = 0; while (n > 0) { if (k & 1) { res += binexp(2, n - 1); } k >>= 1; n--; } cout << res + 1 << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...