結果

問題 No.2782 メルセンヌ数総乗
ユーザー dp_ijk
提出日時 2024-06-17 23:44:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 196 bytes
コンパイル時間 429 ms
コンパイル使用メモリ 82,552 KB
実行使用メモリ 53,752 KB
最終ジャッジ日時 2024-06-17 23:44:35
合計ジャッジ時間 2,685 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import prod
N = int(input())
M = [-1, -1] + [pow(2, i) - 1 for i in range(2, N+2)]

P = prod(M[2:N+1])
r = P % M[N+1]

ans = r == 0

if ans is True:
   print("Yes")
else:
   print("No")
0