結果
問題 | No.1058 素敵な数 |
ユーザー | ikd |
提出日時 | 2020-05-23 09:38:28 |
言語 | F# (F# 4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 727 bytes |
コンパイル時間 | 9,586 ms |
コンパイル使用メモリ | 184,272 KB |
実行使用メモリ | 36,644 KB |
最終ジャッジ日時 | 2024-04-16 10:45:59 |
合計ジャッジ時間 | 15,089 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 441 ms
35,992 KB |
testcase_01 | AC | 442 ms
36,512 KB |
testcase_02 | AC | 440 ms
36,096 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (548 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
// Learn more about F# at http://fsharp.org open System let isPrime n = if n = 1L then false else seq { 2L .. n } |> Seq.filter (fun i -> i * i <= n) |> Seq.forall (fun i -> n % i <> 0L) [<EntryPoint>] let main argv = let n = stdin.ReadLine() |> int let primes = Seq.initInfinite (fun i -> i |> int64) |> Seq.skip 100000 |> Seq.filter isPrime |> Seq.take 10 let niceNumbers = Seq.singleton 1L |> Seq.append (primes |> Seq.collect (fun p -> (primes |> Seq.map (fun q -> p * q)))) |> Seq.sort niceNumbers |> Seq.item (n - 1) |> printfn "%d" 0 // return an integer exit code