Submission #644060

#TimeUsernameProblemLanguageResultExecution timeMemory
644060tvladm2009Rack (eJOI19_rack)C++14
100 / 100
8 ms320 KiB
#include <bits/stdc++.h>
#define int ll
 
using ll = long long;

const int MOD = 1e9 + 7;

signed main() {
  std::ios_base::sync_with_stdio(0);
  std::cin.tie(0);
  int n, k;
  std::cin >> n >> k;
  int answer = 0;
  k--;
  for (int i = 1; i <= n; i++) {
    answer = (answer * 2 % MOD + k % 2) % MOD;
    k /= 2;
  }
  answer++;
  std::cout << answer % MOD;
  return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...