Submission #1180095

#TimeUsernameProblemLanguageResultExecution timeMemory
1180095mishasimRack (eJOI19_rack)C++20
40 / 100
0 ms328 KiB
#include <iostream> using namespace std; #define endl '\n' long long step(int n) { if(n==0)return 1; else { long long res = 2; for(int i = 2 ; i<=n ; i++)res*=2; return res; } } long long n,k,step1,curr,st,j,curr1,kof; const long mod = 1000000007; int main() { ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>n>>k; j = 1; kof = 0; while(k!=1) { if(k%2==0){kof+=step(n-j);k/=2;} else { k/=2; k++; } j++; } cout<<(kof+k)%mod; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...