제출 #464875

#제출 시각아이디문제언어결과실행 시간메모리
464875ewirlanRack (eJOI19_rack)C++17
40 / 100
1 ms204 KiB
//RACK #define _CTR_SECURE_NO_WARNINGS #include <iostream> #include <algorithm> typedef long long int ll; template <typename T> T in() { T x; std::cin >> x; return x; } constexpr int mod = 1e9 + 7; int main() { std::cin.tie(nullptr); std::cout.tie(nullptr); std::ios_base::sync_with_stdio(0); int n(in<int>()), K(in<int>()); ll p(0), k((1ll << std::min(62, n)) - 1), s, odp(1), pot(1); while (k > p) { s = (p + k + 1) / 2; if (K <= s)k = s - 1; else { p = s; odp = (odp + pot) % mod; } pot = (pot * 2) % mod; } std::cout << odp << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...