結果

問題 No.2782 メルセンヌ数総乗
コンテスト
ユーザー KDKJ
提出日時 2024-06-29 02:41:14
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 1,442 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 255 ms
コンパイル使用メモリ 85,336 KB
実行使用メモリ 91,796 KB
最終ジャッジ日時 2026-03-18 12:05:39
合計ジャッジ時間 3,304 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from heapq import heappush, heappop, heapify
from collections import defaultdict, deque,Counter
from math import ceil, floor, sqrt, factorial, gcd, cos, sin, pi, acos, asin
from itertools import permutations, combinations, product, accumulate
from bisect import bisect_left, bisect_right, insort
from copy import deepcopy
from fractions import Fraction
from random import randint
import sys
from functools import cache,lru_cache #@lru_cache(maxsize=None)
from time import time
from sortedcontainers import SortedSet, SortedList, SortedDict # type: ignore
sys.setrecursionlimit(10**7)
vector1 = [[0, -1], [1, 0], [0, 1], [-1, 0]]
vector2 = [[0, 1], [1, 0], [-1, 0], [0, -1],
           [1,-1], [-1, 1], [1, 1], [-1, -1]]
alphabet = "abcdefghijklmnopqrstuvwxyz"


def prime_factorial(n):
    p = []
    i = 2
    while i * i <= n:
        while n%i == 0:
            p.append(i)
            n = n // i
        i += 1
    if n != 1:
        p.append(n)
    return p


def main():
    
    
    N = int(input())
    C = defaultdict(int)
    if N < 3:
        print("No")
        exit()
    for i in range(2,N+1):
        p = prime_factorial(pow(2,i)-1)
        for x in p:
            C[x] += 1
            
    c = Counter(prime_factorial(pow(2,N+1)-1))
    for key in c.keys():
        if c[key] > C[key]:
            print("No")
            exit()
    print("Yes")
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()


0