Submission #1173488

#TimeUsernameProblemLanguageResultExecution timeMemory
1173488andriy57Rack (eJOI19_rack)C++20
0 / 100
0 ms324 KiB
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; #define forin for(int i = 1; i <= n; i++) #define stforin for(int i = 0; i < n; i++) #define forim for(int i = 1; i <= m; i++) #define forjn for(int j = 1; j <= n; j++) #define forch(j, n) for(int i = j; i <= n; i++) #define forch2(i, j, n) for(int i = j; i <= n; i++) #define forjm for(int j = 1; j <= m; j++) #define lol long long #define lb long double #define all(a) (x).begin(), (x).end(); #define endl '\n' #define debug cout << "Completed" << endl; #define fix(n, m) cout << fixed; cout.precision(m); cout << n << endl #define Yes cout << "YES" << endl #define No cout << "NO" << endl #define bads cout << -1 << endl #define pll pair<lol, lol> #define mod 1000000007 #define fst first #define snd second #define inf 1e15 #define tofix cin ; string sbuf; ostringstream buf(sbuf); istringstream atcin(sbuf); lol gcd(lol a, lol b) { while (a != 0 && b != 0) if (a > b) a %= b; else b %= a; return a + b; } lol lcm(lol a, lol b) { return a / gcd(a, b) * b; } bool issqrt(lol n) { lb x = sqrt(n); if (x == (lol)x) return 1; return 0; } lol easy(lol n) { if (n == 1) return 0; for (int i = 2; i * i <= n; i++) if (n % i == 0) return 0; return 1; } string bin(int v) { string ans; while (v != 0) { ans += to_string((v % 2)); v /= 2; } return ans; } //priority_queue <pll, vector<pll>, greater<pll>> q const long long N = 1e6 + 10; lol ts, n, k, en, m, a[1048580]; void solve() { cin >> n >> k; en = pow(2, n); m = en / 2 + (en % 2); forch(1, m) { if (i % 2) a[i] = i; else a[i] = i + m - (i / 2); } cout << a[k] << endl; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ts = 1; //cin >> ts; while (ts--) solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...