Submission #603811

#TimeUsernameProblemLanguageResultExecution timeMemory
603811LextyleRack (eJOI19_rack)C++17
100 / 100
7 ms4052 KiB
#include <bits/stdc++.h> #pragma warning(disable : 4996) #pragma warning(disable : 6031) #define USACO freopen("clumsy.in", "r", stdin); freopen("clumsy.out", "w+", stdout); #define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); using namespace std; int powmod[1000000]; int main() { //USACO; fastIO; int n, ans = 1; long long k; cin >> n >> k; powmod[0] = 1; for (int i = 1; i < n; i++) powmod[i] = (powmod[i - 1] * 2) % 1000000007; for (int i = n - 1, j = 0; i >= 0; i--, j++) { if (k % 2 == 0) ans = (ans + powmod[i]) % 1000000007; k = k / 2 + (k % 2); } cout << ans << "\n"; }

Compilation message (stderr)

rack.cpp:2: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
    2 | #pragma warning(disable : 4996)
      | 
rack.cpp:3: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
    3 | #pragma warning(disable : 6031)
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...