結果
問題 |
No.9005 実行時間/使用メモリテスト(テスト用)
|
ユーザー |
![]() |
提出日時 | 2016-08-24 11:48:51 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 606 ms / 3,000 ms |
コード長 | 613 bytes |
コンパイル時間 | 10,443 ms |
コンパイル使用メモリ | 187,808 KB |
実行使用メモリ | 67,068 KB |
最終ジャッジ日時 | 2024-11-08 01:50:13 |
合計ジャッジ時間 | 14,859 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (246 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/
ソースコード
open System.Collections.Generic // open System.Diagnostics let sieveOfEratosthenes n = let isPrime = Array.create n true let primes = new List<int>() Array.set isPrime 0 false Array.set isPrime 1 false for i = 2 to n - 1 do if isPrime.[i] then primes.Add(i) for j in 2 * i .. i .. n - 1 do Array.set isPrime j false primes let () = let n = 5000000 // let stopwatch = Stopwatch.StartNew() let primes = sieveOfEratosthenes n // stopwatch.Stop() // printfn "%.3f ms" stopwatch.Elapsed.TotalMilliseconds printfn "%d" 0