結果
問題 | No.2782 メルセンヌ数総乗 |
ユーザー |
![]() |
提出日時 | 2024-06-29 02:41:14 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,442 bytes |
コンパイル時間 | 172 ms |
コンパイル使用メモリ | 82,276 KB |
実行使用メモリ | 89,340 KB |
最終ジャッジ日時 | 2024-06-29 02:41:20 |
合計ジャッジ時間 | 3,867 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 20 |
ソースコード
from heapq import heappush, heappop, heapifyfrom collections import defaultdict, deque,Counterfrom math import ceil, floor, sqrt, factorial, gcd, cos, sin, pi, acos, asinfrom itertools import permutations, combinations, product, accumulatefrom bisect import bisect_left, bisect_right, insortfrom copy import deepcopyfrom fractions import Fractionfrom random import randintimport sysfrom functools import cache,lru_cache #@lru_cache(maxsize=None)from time import timefrom sortedcontainers import SortedSet, SortedList, SortedDict # type: ignoresys.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 = 2while i * i <= n:while n%i == 0:p.append(i)n = n // ii += 1if n != 1:p.append(n)return pdef 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] += 1c = 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()