結果
| 問題 |
No.2782 メルセンヌ数総乗
|
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2024-06-15 05:06:19 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 505 bytes |
| コンパイル時間 | 9,874 ms |
| コンパイル使用メモリ | 503,788 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-15 05:06:30 |
| 合計ジャッジ時間 | 11,554 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
Bint now=1;
Bint tmp=2;
rep(i,n-1){
tmp*=2;
now*=(tmp-1);
}
tmp*=2;
if(now%(tmp-1)==0) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
}
umezo