結果
問題 | No.1058 素敵な数 |
ユーザー |
![]() |
提出日時 | 2023-02-07 03:43:02 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 104 ms / 2,000 ms |
コード長 | 237 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-07-05 03:19:17 |
合計ジャッジ時間 | 1,805 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
コンパイルメッセージ
Syntax OK
ソースコード
require 'prime'n=gets.to_iif n==1 thenputs 1elsep1=100001ans=1ps=[]m=n-2while n>1 doif p1.prime? thenn-=1ps<<p1endp1+=2endans=[]ps.each{|x|ps.each{|y|ans<<x*y}}puts ans.uniq.sort[m]end