| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 993515 | lazar3141 | Rack (eJOI19_rack) | C++14 | 6 ms | 8300 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define int long long
int md = 1e9+7;
void solve(){
int n, k;cin>>n>>k;
vector<int> v(1e6+10);
v[0] = 1;
for(int i = 1;i<1e6+10;i++) v[i] = (v[i-1]*2)%md;
int ans = 0;
while(k>1){
if(k%2==0) ans+=v[n-1];
ans%=md;
k = (k+1)/2;
n--;
}
ans++;
ans%=md;
cout<<ans<<endl;
}
int32_t main(){
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(false);
int t = 1;
//cin>>t;
while(t--){
solve();
}
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
