結果
| 問題 |
No.2782 メルセンヌ数総乗
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-14 22:40:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 978 bytes |
| コンパイル時間 | 1,217 ms |
| コンパイル使用メモリ | 112,384 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-14 22:40:24 |
| 合計ジャッジ時間 | 2,648 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <cmath>
#include <cstdio>
#include <vector>
#include <list>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <stack>
#include <fstream>
#include <queue>
#include <iomanip>
#include <iterator>
#include <map>
#include <unordered_map>
#include <climits>
#include <cstdint>
#include <set>
#include <assert.h>
#include <numeric>
#include <random>
#include <chrono>
#define fast ios_base::sync_with_stdio(false)
using namespace std;
#define mxn (long long)(1e5+5)
#define mod (long long)(1e9+7)
#define mod1 (uint64_t)(998244353)
#define inf (long long)(3e5)
//mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count());
void solve(){
long long n;
cin>>n;
long long ans=1;
if(n==1) return void(cout<<"No\n");
for(int i=2;i<=n;i++) ans*=(pow(2ll, i)-1);
long long den=pow(2ll, n+1)-1;
cout<<(ans%den==0?"Yes\n":"No\n");
}
int main(){
fast;
int t;
t=1;
//cin>>t;
while(t--){
solve();
//cout<<(solve()?"yes\n":"no\n");
}
}