# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
775342 | 2023-07-06T09:51:55 Z | vjudge1 | Rack (eJOI19_rack) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; #define int long long #define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); vector <bool> v; int32_t main(){ faster int n,m;cin>>n>>m; m--; while(m>0){ v.push_back(m%2); m/=2; } while(v.size()!=n){ v.push_back(0); } reverse(v.begin(),v.end()); int cev=0; for(int i=0;i<n;i++){ if(v[i])cev+=1<<i; } cout<<(cev+1)%mod<<'\n'; return 0; }