結果

問題 No.1058 素敵な数
ユーザー ttrttr
提出日時 2020-05-24 21:58:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,059 ms / 2,000 ms
コード長 406 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 18,560 KB
最終ジャッジ日時 2024-04-20 13:19:37
合計ジャッジ時間 11,257 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 875 ms
18,560 KB
testcase_01 AC 999 ms
18,432 KB
testcase_02 AC 969 ms
18,560 KB
testcase_03 AC 897 ms
18,560 KB
testcase_04 AC 896 ms
18,560 KB
testcase_05 AC 961 ms
18,560 KB
testcase_06 AC 971 ms
18,560 KB
testcase_07 AC 889 ms
18,560 KB
testcase_08 AC 1,059 ms
18,560 KB
testcase_09 AC 900 ms
18,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

M = 10**5
L = [0]*(10*M+1)
L2 = []
for i in range(2, 10*M+1):
    if L[i] == 0:
        j = 1
        while i*j <= 10*M:
            L[i*j] = 1
            j += 1
        if i > M:
            L2.append(i)
        if len(L2) > N:
            break
ans = [1]
for i in range(N):
    ans.append(L2[i]**2)
    for j in range(i+1, N):
        ans.append(L2[i]*L2[j])
ans.sort()
print(ans[N-1])
0