| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1364617 | kmath628 | Rack (eJOI19_rack) | C++20 | 6 ms | 7952 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll p2[1000009];
int main(){
int n,i,c=0;
ll k,ans=0;
scanf("%d %lld",&n,&k);
p2[0]=1;
for(i=1;i<=n;i++) p2[i]=p2[i-1]*2%mod;
k--;
while(k>0){
if(k%2) ans+=p2[n-1-c];
c++;
k/=2;
}
ans=(ans+1)%mod;
printf("%lld\n",ans);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
