結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー kuuso1kuuso1
提出日時 2016-08-23 23:04:04
言語 F#
(F# 4.0)
結果
TLE  
実行時間 -
コード長 910 bytes
コンパイル時間 8,668 ms
コンパイル使用メモリ 200,968 KB
実行使用メモリ 193,552 KB
最終ジャッジ日時 2024-04-25 12:09:48
合計ジャッジ時間 27,106 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 312 ms
34,660 KB
testcase_01 AC 313 ms
34,504 KB
testcase_02 AC 310 ms
34,840 KB
testcase_03 AC 370 ms
59,296 KB
testcase_04 AC 315 ms
34,148 KB
testcase_05 TLE -
testcase_06 AC 575 ms
83,072 KB
testcase_07 AC 310 ms
34,924 KB
testcase_08 AC 309 ms
34,372 KB
testcase_09 AC 302 ms
34,796 KB
testcase_10 AC 314 ms
34,944 KB
testcase_11 AC 309 ms
34,892 KB
testcase_12 AC 317 ms
36,584 KB
testcase_13 AC 312 ms
35,348 KB
testcase_14 AC 316 ms
36,720 KB
testcase_15 AC 303 ms
34,936 KB
testcase_16 AC 317 ms
34,888 KB
testcase_17 AC 315 ms
35,092 KB
testcase_18 AC 310 ms
34,836 KB
testcase_19 AC 363 ms
59,256 KB
testcase_20 AC 489 ms
81,856 KB
testcase_21 AC 376 ms
61,012 KB
testcase_22 AC 365 ms
59,204 KB
testcase_23 AC 429 ms
68,036 KB
testcase_24 AC 495 ms
81,736 KB
testcase_25 AC 583 ms
82,960 KB
testcase_26 AC 583 ms
82,916 KB
testcase_27 AC 358 ms
57,788 KB
testcase_28 AC 433 ms
68,404 KB
testcase_29 AC 560 ms
82,728 KB
testcase_30 AC 374 ms
58,740 KB
testcase_31 AC 535 ms
82,464 KB
testcase_32 AC 574 ms
82,916 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (215 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/

ソースコード

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