結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー kuuso1kuuso1
提出日時 2016-08-23 23:18:18
言語 F#
(F# 4.0)
結果
TLE  
実行時間 -
コード長 877 bytes
コンパイル時間 9,305 ms
コンパイル使用メモリ 211,468 KB
実行使用メモリ 195,664 KB
最終ジャッジ日時 2024-04-25 12:15:30
合計ジャッジ時間 25,006 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 334 ms
34,784 KB
testcase_01 AC 301 ms
35,040 KB
testcase_02 AC 299 ms
34,864 KB
testcase_03 AC 351 ms
59,376 KB
testcase_04 AC 305 ms
34,524 KB
testcase_05 TLE -
testcase_06 AC 574 ms
82,804 KB
testcase_07 AC 307 ms
34,624 KB
testcase_08 AC 310 ms
34,780 KB
testcase_09 AC 318 ms
34,520 KB
testcase_10 AC 304 ms
35,060 KB
testcase_11 AC 303 ms
34,784 KB
testcase_12 AC 310 ms
36,308 KB
testcase_13 AC 300 ms
35,080 KB
testcase_14 AC 322 ms
35,808 KB
testcase_15 AC 301 ms
34,672 KB
testcase_16 AC 307 ms
34,216 KB
testcase_17 AC 304 ms
34,964 KB
testcase_18 AC 302 ms
34,960 KB
testcase_19 AC 353 ms
59,372 KB
testcase_20 AC 471 ms
81,716 KB
testcase_21 AC 364 ms
61,164 KB
testcase_22 AC 356 ms
59,196 KB
testcase_23 AC 413 ms
67,616 KB
testcase_24 AC 469 ms
81,836 KB
testcase_25 AC 562 ms
82,940 KB
testcase_26 AC 567 ms
82,692 KB
testcase_27 AC 349 ms
58,188 KB
testcase_28 AC 407 ms
67,752 KB
testcase_29 AC 576 ms
82,616 KB
testcase_30 AC 353 ms
59,024 KB
testcase_31 AC 552 ms
82,324 KB
testcase_32 AC 547 ms
82,756 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (276 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
        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