# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1119003 | Dan4Life | Rack (eJOI19_rack) | C++17 | 146 ms | 504 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
using ll=long long;
ll n,k,l,r,M=1e9+7;
ll p(ll b){
if(!b)return 1;
ll x=p(b/2);x*=x;x%=M;
return (x*(b&1?2:1))%M;
}
main(){
cin>>n>>k,l=1,r=p(n);
while(n--){
if(k%2)k++,r=(r+M-p(n))%M;
else l=(l+p(n))%M;k/=2;
}
cout<<l;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |