結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
78,992 KB
testcase_01 AC 121 ms
88,764 KB
testcase_02 WA -
testcase_03 AC 122 ms
88,680 KB
testcase_04 AC 123 ms
88,848 KB
testcase_05 AC 84 ms
79,172 KB
testcase_06 AC 121 ms
88,968 KB
testcase_07 AC 120 ms
88,888 KB
testcase_08 AC 119 ms
88,832 KB
testcase_09 AC 123 ms
88,732 KB
testcase_10 AC 129 ms
88,784 KB
testcase_11 AC 119 ms
88,980 KB
testcase_12 AC 119 ms
88,672 KB
testcase_13 AC 81 ms
79,292 KB
testcase_14 AC 83 ms
79,040 KB
testcase_15 AC 82 ms
79,076 KB
testcase_16 AC 81 ms
79,064 KB
testcase_17 AC 80 ms
79,080 KB
testcase_18 AC 82 ms
78,976 KB
testcase_19 AC 84 ms
79,084 KB
testcase_20 AC 82 ms
79,080 KB
testcase_21 AC 81 ms
79,036 KB
testcase_22 AC 83 ms
79,164 KB
testcase_23 AC 81 ms
79,164 KB
testcase_24 AC 120 ms
88,616 KB
testcase_25 AC 83 ms
79,124 KB
testcase_26 AC 118 ms
88,616 KB
testcase_27 AC 86 ms
78,936 KB
testcase_28 AC 82 ms
79,084 KB
testcase_29 AC 119 ms
88,652 KB
testcase_30 AC 123 ms
88,776 KB
testcase_31 AC 84 ms
79,264 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 120 ms
89,028 KB
testcase_36 AC 81 ms
79,300 KB
testcase_37 AC 83 ms
79,228 KB
testcase_38 AC 81 ms
79,312 KB
testcase_39 AC 123 ms
88,836 KB
testcase_40 AC 119 ms
88,700 KB
testcase_41 AC 121 ms
88,624 KB
testcase_42 AC 121 ms
88,712 KB
testcase_43 AC 119 ms
88,788 KB
testcase_44 AC 81 ms
79,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if n % 3 == 0:
    print(3)
    exit()
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