結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー kuuso1kuuso1
提出日時 2016-08-24 23:15:10
言語 F#
(.NET 7)
結果
AC  
実行時間 286 ms / 1,000 ms
コード長 875 bytes
コンパイル時間 5,783 ms
コンパイル使用メモリ 176,084 KB
実行使用メモリ 29,340 KB
最終ジャッジ日時 2023-08-22 05:02:06
合計ジャッジ時間 12,177 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
22,980 KB
testcase_01 AC 92 ms
20,820 KB
testcase_02 AC 92 ms
24,904 KB
testcase_03 AC 111 ms
22,944 KB
testcase_04 AC 92 ms
22,928 KB
testcase_05 AC 286 ms
27,144 KB
testcase_06 AC 196 ms
24,976 KB
testcase_07 AC 96 ms
22,852 KB
testcase_08 AC 98 ms
20,848 KB
testcase_09 AC 94 ms
24,976 KB
testcase_10 AC 89 ms
22,868 KB
testcase_11 AC 92 ms
22,880 KB
testcase_12 AC 91 ms
24,852 KB
testcase_13 AC 86 ms
22,852 KB
testcase_14 AC 87 ms
24,984 KB
testcase_15 AC 89 ms
22,916 KB
testcase_16 AC 91 ms
22,784 KB
testcase_17 AC 91 ms
22,924 KB
testcase_18 AC 88 ms
22,832 KB
testcase_19 AC 106 ms
22,900 KB
testcase_20 AC 146 ms
23,868 KB
testcase_21 AC 113 ms
23,068 KB
testcase_22 AC 107 ms
25,016 KB
testcase_23 AC 125 ms
23,468 KB
testcase_24 AC 145 ms
23,980 KB
testcase_25 AC 183 ms
24,888 KB
testcase_26 AC 179 ms
24,860 KB
testcase_27 AC 100 ms
22,868 KB
testcase_28 AC 131 ms
21,452 KB
testcase_29 AC 178 ms
24,960 KB
testcase_30 AC 104 ms
22,860 KB
testcase_31 AC 161 ms
26,412 KB
testcase_32 AC 179 ms
22,740 KB
testcase_33 AC 278 ms
27,372 KB
testcase_34 AC 276 ms
29,340 KB
testcase_35 AC 258 ms
24,756 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

/home/judge/data/code/Main.fs(4,13): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _|]' may indicate a case not covered by the pattern(s).

ソースコード

diff #

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
        let ul1 = L/2 |> double |> sqrt |> int |> (+) 1
        let ul2 = L/2 + 99
        for i = 2 to ul1 do
            if isPrime.[i] = true then
                for j in (i*i)..i..ul2 do isPrime.[j] <- false 
        
        let mutable ans:int64 = 0L
        // printfn "%d" ans
        
        for i = 2 to (L/2 + 1) do
            if isPrime.[i] = true && LL >= ((NL-1L) * (int64 i)) then
                ans <- ans + (int64 (( L - ((N-1) * i) + 1 )))
        
        printfn "%d" ans
        
let mySol = new Sol()
mySol.Solve()
0