結果

問題 No.312 置換処理
ユーザー ronpooronpoo
提出日時 2023-09-08 10:12:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 511 bytes
コンパイル時間 348 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 97,224 KB
最終ジャッジ日時 2023-09-08 10:12:32
合計ジャッジ時間 6,946 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
92,036 KB
testcase_01 WA -
testcase_02 AC 119 ms
97,224 KB
testcase_03 WA -
testcase_04 AC 73 ms
72,004 KB
testcase_05 AC 117 ms
96,940 KB
testcase_06 AC 103 ms
89,096 KB
testcase_07 AC 111 ms
94,708 KB
testcase_08 AC 110 ms
93,848 KB
testcase_09 AC 92 ms
83,776 KB
testcase_10 AC 98 ms
85,116 KB
testcase_11 AC 109 ms
94,288 KB
testcase_12 AC 97 ms
88,712 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 73 ms
71,816 KB
testcase_23 AC 74 ms
71,568 KB
testcase_24 AC 75 ms
71,824 KB
testcase_25 AC 74 ms
71,868 KB
testcase_26 AC 73 ms
71,816 KB
testcase_27 WA -
testcase_28 AC 74 ms
71,700 KB
testcase_29 AC 74 ms
71,740 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 84 ms
77,840 KB
testcase_33 AC 91 ms
82,420 KB
testcase_34 AC 90 ms
82,448 KB
testcase_35 AC 92 ms
82,556 KB
testcase_36 AC 73 ms
71,988 KB
testcase_37 AC 74 ms
71,816 KB
testcase_38 WA -
testcase_39 AC 91 ms
82,140 KB
testcase_40 AC 84 ms
77,036 KB
testcase_41 AC 72 ms
71,736 KB
testcase_42 AC 83 ms
77,132 KB
testcase_43 AC 73 ms
71,892 KB
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

# 素数列挙
def prime(x):
    prime = [x if x%2==1 else 2 for x in range(x+1)]
    prime[0] = 1

    for i in range(3, int(x**0.5)+2, 2):
        if prime[i] != i:
            continue   
        for j in range(2*i, x+1, i):
            if prime[j] == j:
                prime[j] = i

    p = {i for i in range(2, x+1) if prime[i] == i}
    return p

p = prime(int(N**0.5)+2)
p = sorted(p)
for v in p:
    if v != 2 and N % v == 0:
        ans = v
        break
else:
    ans = N
print(ans)
0