Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
127142 | 凌艺樽 | 魔法生物 | C++ | 通过 | 100 | 0 MS | 268 KB | 247 | 2024-01-25 08:03:14 |
#include <bits/stdc++.h> using namespace std; const int N =1e5+10; const int INF =0x3f3f3f3f; int n; int main () { while(cin>>n && n!=0) { long long c=pow(2,n-1); if(n!=1)cout<<c%n+1<<endl; else cout<<0<<'\n'; } return 0; }