| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1125800 | orkunhatipoglu37 | Rack (eJOI19_rack) | C++20 | 6 ms | 8264 KiB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
int ekle(int a, int b){
if(a+b>=10000007) return a+b-10000007;
return a+b;
}
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,k;
cin>>n>>k;
vector<int> pw(1000005);
pw[0]=1;
for(int i=1; i<=n; i++){
pw[i]=ekle(pw[i-1],pw[i-1]);
}
int ans=1;
int us=n-1;
while(k!=1){
if(k%2==0) ans=ekle(ans,pw[us]);
us--;
k=(k+1)/2;
}
cout<<ans<<"\n";
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
