結果

問題 No.312 置換処理
ユーザー ynyn
提出日時 2015-12-05 00:50:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 76,284 KB
最終ジャッジ日時 2024-04-27 10:28:20
合計ジャッジ時間 5,368 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
75,104 KB
testcase_01 AC 89 ms
76,284 KB
testcase_02 AC 90 ms
74,648 KB
testcase_03 AC 88 ms
74,640 KB
testcase_04 AC 92 ms
75,036 KB
testcase_05 AC 91 ms
74,060 KB
testcase_06 AC 89 ms
74,508 KB
testcase_07 AC 88 ms
74,528 KB
testcase_08 AC 89 ms
75,212 KB
testcase_09 AC 88 ms
74,872 KB
testcase_10 AC 87 ms
74,864 KB
testcase_11 AC 88 ms
74,452 KB
testcase_12 AC 89 ms
74,400 KB
testcase_13 AC 86 ms
74,212 KB
testcase_14 AC 89 ms
73,760 KB
testcase_15 AC 85 ms
74,456 KB
testcase_16 AC 86 ms
74,056 KB
testcase_17 AC 86 ms
73,972 KB
testcase_18 AC 88 ms
75,488 KB
testcase_19 AC 88 ms
74,420 KB
testcase_20 AC 88 ms
74,356 KB
testcase_21 AC 90 ms
74,728 KB
testcase_22 AC 93 ms
75,576 KB
testcase_23 AC 85 ms
74,640 KB
testcase_24 AC 86 ms
73,692 KB
testcase_25 AC 88 ms
74,196 KB
testcase_26 AC 87 ms
75,120 KB
testcase_27 AC 87 ms
74,416 KB
testcase_28 AC 87 ms
74,336 KB
testcase_29 AC 91 ms
75,012 KB
testcase_30 AC 88 ms
76,168 KB
testcase_31 AC 88 ms
74,512 KB
testcase_32 AC 88 ms
75,484 KB
testcase_33 AC 90 ms
75,556 KB
testcase_34 AC 89 ms
74,624 KB
testcase_35 AC 86 ms
74,436 KB
testcase_36 AC 84 ms
74,304 KB
testcase_37 AC 87 ms
74,780 KB
testcase_38 AC 88 ms
74,640 KB
testcase_39 AC 85 ms
74,436 KB
testcase_40 AC 89 ms
74,516 KB
testcase_41 AC 85 ms
74,052 KB
testcase_42 AC 88 ms
75,420 KB
testcase_43 AC 88 ms
75,032 KB
testcase_44 AC 87 ms
75,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
nn = 10**6
num = [3,4]
table = [True] * (nn + 1)

for i in range(2, nn + 1):
    if not table[i]:
        continue
    k = i + i
    while k < nn + 1:
        table[k] = False
        k += i

    if i == 2 or i == 3 or i == 4:
        continue
    num.append(i)

flag = 0
for i in num:
    if n % i == 0:
        print(i)
        exit()

if n % 2 == 0:
    print(n//2)
    exit()
print(n)
0