結果
問題 | No.989 N×Mマス計算(K以上) |
ユーザー | ikd |
提出日時 | 2020-06-06 22:32:47 |
言語 | F# (F# 4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 863 bytes |
コンパイル時間 | 3,606 ms |
コンパイル使用メモリ | 169,068 KB |
実行使用メモリ | 40,364 KB |
最終ジャッジ日時 | 2023-08-25 02:08:04 |
合計ジャッジ時間 | 7,500 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 91 ms
23,164 KB |
testcase_01 | AC | 87 ms
23,136 KB |
testcase_02 | AC | 87 ms
23,168 KB |
testcase_03 | AC | 94 ms
25,192 KB |
testcase_04 | AC | 91 ms
23,248 KB |
testcase_05 | AC | 94 ms
23,172 KB |
testcase_06 | WA | - |
testcase_07 | AC | 93 ms
23,260 KB |
testcase_08 | WA | - |
testcase_09 | AC | 95 ms
25,176 KB |
testcase_10 | AC | 211 ms
33,592 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 139 ms
36,912 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 178 ms
34,368 KB |
testcase_17 | AC | 136 ms
34,856 KB |
testcase_18 | AC | 160 ms
31,108 KB |
testcase_19 | AC | 172 ms
37,868 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(17,9): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _; _|]' may indicate a case not covered by the pattern(s).
ソースコード
open System // x <= arr[i] let lowerBound x (arr: 'a []) = // arr[lf] < x <= arr[rg] let rec solve lf rg = if rg - lf <= 1 then rg else let mid = (rg + lf) / 2 if arr.[mid] < x then solve mid rg else solve lf mid solve -1 arr.Length [<EntryPoint>] let main _ = let [| n; m; k |] = stdin.ReadLine().Split(' ') |> Array.map int64 let line = stdin.ReadLine().Split(' ') let op = Array.head line |> Seq.head let b = Array.tail line |> Array.map int64 |> Array.sort let a = [| for _ in 1L .. n -> stdin.ReadLine() |> int64 |] a |> Array.sumBy (fun x -> let y = if op = '+' then k - x else k / x let i = b |> lowerBound y |> int64 m - i) |> printfn "%d" 0