結果

問題 No.192 合成数
ユーザー akanayaakanaya
提出日時 2020-03-25 22:26:21
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2025-01-02 00:09:28
合計ジャッジ時間 2,969 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

def checker(n):
    if n == 1:
        return False
    i = 2
    while(i * i <= n):
        if n % i == 0:
            return True
        i += 1
    return False
        
n = int(input())

result = -1
for i in range(n - 100, n + 100 + 1):
    if checker(i):
        result = i
        break

print(result)    
0