| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1308716 | maya_s | Rack (eJOI19_rack) | C++20 | 1 ms | 576 KiB |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = (1e9 + 7);
ll power(ll a, ll b){
if(b == 0) return 1;
ll x = (power(a, b / 2));
if(b % 2 == 0) return (x * x) % mod;
return (((x * x) % mod) * a) % mod;
}
int main(){
ios_base::sync_with_stdio(false); cin.tie(NULL);
ll n, k; cin >> n >> k;
ll x = 0, d = 2;
for(ll i = 1; i <= 60; i++){
ll d = (1ll << i);
if(k % d > d / 2 || k % d == 0) x += power(2, n-i), x %= mod;
}
cout << (x+1) % mod;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
