結果

問題 No.2795 Perfect Number
ユーザー scarlet-Chun-DHscarlet-Chun-DH
提出日時 2024-06-28 21:56:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 367 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 82,276 KB
実行使用メモリ 54,156 KB
最終ジャッジ日時 2024-06-28 21:56:08
合計ジャッジ時間 2,554 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,836 KB
testcase_01 AC 36 ms
53,932 KB
testcase_02 AC 36 ms
53,956 KB
testcase_03 WA -
testcase_04 AC 37 ms
52,336 KB
testcase_05 AC 37 ms
53,808 KB
testcase_06 AC 36 ms
52,252 KB
testcase_07 AC 37 ms
52,792 KB
testcase_08 AC 36 ms
52,812 KB
testcase_09 AC 38 ms
53,408 KB
testcase_10 AC 35 ms
52,988 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 36 ms
53,276 KB
testcase_15 AC 34 ms
53,004 KB
testcase_16 AC 36 ms
53,168 KB
testcase_17 AC 36 ms
51,880 KB
testcase_18 AC 35 ms
53,080 KB
testcase_19 AC 36 ms
53,196 KB
testcase_20 AC 38 ms
52,528 KB
testcase_21 AC 36 ms
52,612 KB
testcase_22 AC 35 ms
52,400 KB
testcase_23 AC 35 ms
53,104 KB
testcase_24 AC 37 ms
52,000 KB
testcase_25 AC 35 ms
52,528 KB
testcase_26 AC 36 ms
53,288 KB
testcase_27 AC 35 ms
52,364 KB
testcase_28 AC 35 ms
53,004 KB
testcase_29 AC 36 ms
53,372 KB
testcase_30 AC 36 ms
53,496 KB
testcase_31 AC 36 ms
53,008 KB
testcase_32 AC 36 ms
52,756 KB
testcase_33 AC 37 ms
51,824 KB
testcase_34 AC 35 ms
53,096 KB
testcase_35 AC 37 ms
53,368 KB
testcase_36 AC 36 ms
52,676 KB
testcase_37 AC 36 ms
53,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
from math import sqrt

n = int(stdin.readline())

a = 2

res = False

def is_prime(num):
	result = True
	for i in range(2, int(sqrt(num))+1):
		if num % i == 0:
			result = False
			break
	return result

for i in range(1, 31):
	if (2 ** (i - 1)) * (2 ** i - 1) == n and is_prime(i):
		res = True
		break

if res:
	print("Yes")
else:
	print("No")
0