結果
問題 | No.407 鴨等素数間隔列の数え上げ |
ユーザー | kuuso1 |
提出日時 | 2016-08-22 23:45:32 |
言語 | F# (F# 4.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 738 bytes |
コンパイル時間 | 9,947 ms |
コンパイル使用メモリ | 200,284 KB |
実行使用メモリ | 190,836 KB |
最終ジャッジ日時 | 2024-04-25 11:27:51 |
合計ジャッジ時間 | 25,359 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 307 ms
38,336 KB |
testcase_01 | AC | 302 ms
35,016 KB |
testcase_02 | AC | 304 ms
34,140 KB |
testcase_03 | RE | - |
testcase_04 | AC | 296 ms
34,692 KB |
testcase_05 | AC | 920 ms
190,836 KB |
testcase_06 | AC | 454 ms
82,888 KB |
testcase_07 | AC | 308 ms
34,756 KB |
testcase_08 | AC | 316 ms
34,548 KB |
testcase_09 | AC | 305 ms
34,460 KB |
testcase_10 | AC | 305 ms
34,744 KB |
testcase_11 | AC | 306 ms
34,008 KB |
testcase_12 | AC | 297 ms
34,468 KB |
testcase_13 | AC | 299 ms
35,164 KB |
testcase_14 | AC | 308 ms
36,576 KB |
testcase_15 | AC | 296 ms
34,572 KB |
testcase_16 | AC | 295 ms
34,320 KB |
testcase_17 | AC | 304 ms
34,004 KB |
testcase_18 | AC | 295 ms
34,804 KB |
testcase_19 | RE | - |
testcase_20 | RE | - |
testcase_21 | AC | 299 ms
35,092 KB |
testcase_22 | AC | 304 ms
34,852 KB |
testcase_23 | AC | 392 ms
67,728 KB |
testcase_24 | AC | 429 ms
76,280 KB |
testcase_25 | RE | - |
testcase_26 | AC | 452 ms
83,036 KB |
testcase_27 | AC | 300 ms
35,472 KB |
testcase_28 | AC | 359 ms
63,616 KB |
testcase_29 | AC | 491 ms
82,704 KB |
testcase_30 | AC | 321 ms
35,004 KB |
testcase_31 | AC | 485 ms
82,288 KB |
testcase_32 | RE | - |
testcase_33 | TLE | - |
testcase_34 | TLE | - |
testcase_35 | -- | - |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (272 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) /home/judge/data/code/Main.fs(4,13): warning FS0025: この式のパターン マッチが不完全です たとえば、値 '[|_; _; _|]' はパターンに含まれないケースを示す可能性があります。 [/home/judge/data/code/main.fsproj] main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
open System type Sol() = member this.Solve() = let [|N;L|] = stdin.ReadLine().Split() |> Array.map int let NL = int64 N let LL = int64 L let isPrime = Array.create (L/2 + 100) true let mutable primes:int list = [] isPrime.[0] <- false isPrime.[1] <- false for i = 2 to (L/2) do if isPrime.[i] = true && LL >= ((NL-1L) * (int64 i)) then primes <- i :: primes for j in [(i*i)..i..(L/2 + 99)] do isPrime.[j] <- false let ans:int64 = primes |> List.sumBy (fun p -> (( L - ((N-1) * p) + 1 ) |> int64 ) ) printfn "%d" ans () let mySol = new Sol() mySol.Solve()