제출 #302402

#제출 시각아이디문제언어결과실행 시간메모리
302402MasterTasterRack (eJOI19_rack)C++14
100 / 100
9 ms7936 KiB
#include <bits/stdc++.h> #define pb push_back #define ll long long #define pii pair<int, int> #define xx first #define yy second #define MOD 1000000007 using namespace std; ll n, k, ress; ll dvaNa[1000010]; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n>>k; k--; dvaNa[0]=1; for (int i=1; i<=n+1; i++) dvaNa[i]=(dvaNa[i-1]*2)%MOD; int i=0; while (k) { int cif=k%2; k/=2; ress=(ress+(cif*(dvaNa[n-1-i])%MOD)%MOD)%MOD; i++; } cout<<(ress+1)%MOD; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...