| 记录编号 | 281931 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 2192.约瑟夫之生存之道 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.002 s | ||
| 提交时间 | 2016-07-12 17:00:10 | 内存使用 | 0.31 MiB | ||
#include<iostream>
#include<cstdio>
using namespace std;
long long n,d=1;
int main(){
freopen("JOSEPHUS.in","r",stdin);
freopen("JOSEPHUS.out","w",stdout);
cin>>n;
while(d*2<=n) d<<=1;
cout<<2*(n-d)+1;
}