結果

問題 No.1058 素敵な数
ユーザー kozykozy
提出日時 2020-07-22 17:47:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 8,052 KB
最終ジャッジ日時 2023-09-03 14:53:41
合計ジャッジ時間 1,145 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,924 KB
testcase_01 AC 16 ms
7,964 KB
testcase_02 AC 16 ms
7,952 KB
testcase_03 AC 16 ms
7,968 KB
testcase_04 AC 16 ms
8,000 KB
testcase_05 AC 16 ms
7,896 KB
testcase_06 AC 15 ms
7,896 KB
testcase_07 AC 16 ms
7,944 KB
testcase_08 AC 16 ms
7,996 KB
testcase_09 AC 16 ms
8,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def is_prime(n):
    if n == 1: return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
L=list()
for i in range(100000,100130):
  if is_prime(i)==True:
    L.append(i)
R=list()
for i in range(9):
  for j in range(9):
    R.append(L[i]*L[j])
R=list(sorted(set(R)))
N=int(input())
if N==1:
  print(1)
else:
  print(R[N-2])
0