結果
| 問題 | No.2782 メルセンヌ数総乗 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-14 21:28:56 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 419 bytes |
| 記録 | |
| コンパイル時間 | 1,175 ms |
| コンパイル使用メモリ | 212,884 KB |
| 実行使用メモリ | 11,944 KB |
| 最終ジャッジ日時 | 2026-07-04 22:01:23 |
| 合計ジャッジ時間 | 2,014 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N; cin >> N;
if(N == 1){cout << "No" << endl; return 0;}
vector<long long> M;
for(int i=2; i<=N; i++) M.push_back((1LL<<i)-1);
long long now = (1LL<<(N+1))-1;
for(auto m : M) now = now/gcd(m,now);
if(now == 1) cout << "Yes" << endl;
else cout << "No" << endl;
}