結果
問題 | No.713 素数の和 |
ユーザー |
|
提出日時 | 2020-06-13 15:36:09 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 401 ms / 2,000 ms |
コード長 | 336 bytes |
コンパイル時間 | 13,639 ms |
コンパイル使用メモリ | 185,660 KB |
実行使用メモリ | 35,028 KB |
最終ジャッジ日時 | 2024-06-25 12:26:15 |
合計ジャッジ時間 | 18,599 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (340 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/
ソースコード
let isPrime n =let limit = n |> float |> sqrt |> ceil |> intlet rec check i =if i > limit then true elif n % i = 0 then false else check (i+1)if n > 2 then check 2 else 2 = nlet n = stdin.ReadLine().Trim() |> intlet result = seq { for n in 2 .. n do n } |> Seq.filter isPrime |> Seq.sumprintfn "%d" result