이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define all(aa) aa.begin(), aa.end()
#define mod 1'000'000'007
ll fp(int base, int power){
if(!power) return 1;
ll res = fp(base, power/2);
if(power&1) return res * res % mod * base % mod;
else return res * res % mod;
}
int main(){
ll n, k;
cin>>n>>k;
ll ans=1;
while(n--){
if(k%2==0) ans=(ans+fp(2, n))%mod;
k=(k+1)/2;
}
cout<<ans<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |