// Ahmadov orz
/// successful failure
/// MALLL, SKILL ISSUEZ
#include <bits/stdc++.h>
/// #include <ext/pb_ds/assoc_container.hpp>
using namespace std;
/// using namespace __gnu_pbds;
#define int long long
#define pb push_back
#define pii pair<int, int>
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define drop(x) cout<<x<<endl;return
// template <class T>
// using isTree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
/// sometimes you gotta think simple
struct custom_hash {
size_t operator()(uint64_t x) const {
static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
x ^= FIXED_RANDOM;
return x ^ (x >> 16);
}
};
const int MOD = 1e9 + 7;
int binpow(int a, int b, int MOD) {
if (b == 0) {
return 1;
}
int res = binpow(a, b>>1, MOD);
if (b&1) {
return (((res * res) % MOD) * a) % MOD;
}
else {
return (res * res) % MOD;
}
}
void failure()
{
int n, k;
cin >> n >> k;
int yaprak = 1;
int dist = binpow(2,n,MOD);
vector <int> pos;
//cout << "mal: " << dist << endl;
dist/=2;
for (int i = 1; i <= dist; i++) {
pos.pb(i);
pos.pb(i + dist);
}
// for (int v:pos) {
// cout << v << " ";
// }
// cout << endl;
drop(pos[k-1]);
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int tt = 1;
// cin >> tt;
while (tt--)
{
failure();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |