結果

問題 No.1058 素敵な数
ユーザー now4estnow4est
提出日時 2020-05-22 21:46:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-04-15 16:30:12
合計ジャッジ時間 1,191 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
51,840 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def is_prime(n):
    """
    via https://qiita.com/srtk86/items/874639e361917e5016d4
    """
    if n == 1:
        return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True

N = int(input())

i = 1
count = 1
while True:
    if i == 100000:
        break
    if not is_prime(i):
        if count == N:
            print(i)
            break
        count += 1
    i += 1
0