結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー kuuso1kuuso1
提出日時 2016-08-22 23:40:38
言語 F#
(F# 4.0)
結果
TLE  
実行時間 -
コード長 775 bytes
コンパイル時間 9,639 ms
コンパイル使用メモリ 200,308 KB
実行使用メモリ 190,992 KB
最終ジャッジ日時 2024-04-25 11:27:11
合計ジャッジ時間 32,844 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 357 ms
34,144 KB
testcase_01 AC 347 ms
34,652 KB
testcase_02 AC 356 ms
33,848 KB
testcase_03 AC 434 ms
59,408 KB
testcase_04 AC 344 ms
34,116 KB
testcase_05 TLE -
testcase_06 AC 504 ms
83,028 KB
testcase_07 AC 342 ms
34,788 KB
testcase_08 AC 347 ms
33,696 KB
testcase_09 AC 339 ms
34,784 KB
testcase_10 AC 341 ms
34,400 KB
testcase_11 AC 339 ms
34,088 KB
testcase_12 AC 338 ms
35,076 KB
testcase_13 AC 347 ms
34,528 KB
testcase_14 AC 348 ms
36,144 KB
testcase_15 AC 338 ms
34,108 KB
testcase_16 AC 341 ms
33,916 KB
testcase_17 AC 340 ms
34,412 KB
testcase_18 AC 338 ms
34,932 KB
testcase_19 AC 445 ms
60,932 KB
testcase_20 AC 684 ms
81,956 KB
testcase_21 AC 353 ms
35,820 KB
testcase_22 AC 353 ms
35,460 KB
testcase_23 AC 463 ms
67,752 KB
testcase_24 AC 444 ms
76,064 KB
testcase_25 AC 872 ms
82,772 KB
testcase_26 AC 535 ms
82,788 KB
testcase_27 AC 340 ms
35,528 KB
testcase_28 AC 402 ms
63,900 KB
testcase_29 AC 553 ms
82,720 KB
testcase_30 AC 345 ms
35,472 KB
testcase_31 AC 547 ms
82,420 KB
testcase_32 AC 799 ms
82,748 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (246 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
        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 
        
        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