結果

問題 No.312 置換処理
ユーザー ynyn
提出日時 2015-12-05 00:25:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 430 bytes
コンパイル時間 683 ms
コンパイル使用メモリ 86,656 KB
実行使用メモリ 88,832 KB
最終ジャッジ日時 2023-10-12 15:20:50
合計ジャッジ時間 8,388 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
88,412 KB
testcase_01 AC 116 ms
88,484 KB
testcase_02 WA -
testcase_03 AC 119 ms
88,652 KB
testcase_04 AC 116 ms
88,304 KB
testcase_05 AC 115 ms
88,360 KB
testcase_06 AC 119 ms
88,548 KB
testcase_07 AC 122 ms
88,520 KB
testcase_08 AC 120 ms
88,404 KB
testcase_09 AC 118 ms
88,400 KB
testcase_10 AC 114 ms
88,692 KB
testcase_11 AC 115 ms
88,368 KB
testcase_12 AC 116 ms
88,692 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 124 ms
88,472 KB
testcase_23 AC 84 ms
78,812 KB
testcase_24 AC 117 ms
88,292 KB
testcase_25 AC 118 ms
88,308 KB
testcase_26 AC 118 ms
88,396 KB
testcase_27 AC 119 ms
88,688 KB
testcase_28 AC 121 ms
88,356 KB
testcase_29 AC 121 ms
88,424 KB
testcase_30 AC 120 ms
88,616 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 117 ms
88,368 KB
testcase_36 AC 120 ms
88,312 KB
testcase_37 AC 118 ms
88,304 KB
testcase_38 WA -
testcase_39 AC 116 ms
88,692 KB
testcase_40 AC 117 ms
88,400 KB
testcase_41 AC 115 ms
88,288 KB
testcase_42 AC 117 ms
88,564 KB
testcase_43 AC 119 ms
88,592 KB
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if n == 4:
    print(4)
    exit()

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

    num.append(i)

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

if flag:
    print(n//2)
    exit()
print(n)
0