結果
問題 |
No.713 素数の和
|
ユーザー |
|
提出日時 | 2020-06-13 16:00:28 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 346 ms / 2,000 ms |
コード長 | 345 bytes |
コンパイル時間 | 9,849 ms |
コンパイル使用メモリ | 189,224 KB |
実行使用メモリ | 34,616 KB |
最終ジャッジ日時 | 2024-06-25 13:11:31 |
合計ジャッジ時間 | 13,013 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (281 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 |> int let 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 = n let n = stdin.ReadLine().Trim() |> int let mutable result = 0 for i in 2 .. n do if isPrime i then result <- result + i printfn "%d" result