結果

問題 No.312 置換処理
ユーザー ynyn
提出日時 2015-12-05 00:28:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 89,140 KB
最終ジャッジ日時 2023-10-12 15:21:12
合計ジャッジ時間 6,788 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 126 ms
88,660 KB
testcase_02 WA -
testcase_03 AC 118 ms
89,000 KB
testcase_04 AC 115 ms
88,740 KB
testcase_05 AC 113 ms
88,740 KB
testcase_06 AC 117 ms
88,772 KB
testcase_07 AC 117 ms
88,956 KB
testcase_08 AC 120 ms
88,736 KB
testcase_09 AC 116 ms
88,704 KB
testcase_10 AC 117 ms
88,800 KB
testcase_11 AC 119 ms
88,956 KB
testcase_12 AC 117 ms
88,704 KB
testcase_13 AC 82 ms
79,204 KB
testcase_14 AC 78 ms
79,124 KB
testcase_15 AC 84 ms
79,400 KB
testcase_16 AC 81 ms
79,152 KB
testcase_17 AC 81 ms
79,344 KB
testcase_18 AC 80 ms
79,160 KB
testcase_19 AC 81 ms
79,088 KB
testcase_20 AC 80 ms
79,176 KB
testcase_21 AC 83 ms
79,020 KB
testcase_22 AC 119 ms
88,584 KB
testcase_23 AC 84 ms
79,064 KB
testcase_24 AC 118 ms
88,732 KB
testcase_25 AC 118 ms
89,000 KB
testcase_26 AC 117 ms
88,764 KB
testcase_27 AC 80 ms
79,236 KB
testcase_28 AC 117 ms
88,752 KB
testcase_29 AC 116 ms
88,780 KB
testcase_30 AC 119 ms
88,860 KB
testcase_31 AC 81 ms
79,172 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 118 ms
88,908 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 81 ms
79,184 KB
testcase_39 AC 118 ms
88,704 KB
testcase_40 AC 118 ms
88,584 KB
testcase_41 AC 118 ms
88,732 KB
testcase_42 AC 115 ms
88,700 KB
testcase_43 AC 116 ms
88,708 KB
testcase_44 AC 82 ms
78,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if n % 4 == 0:
    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