結果

問題 No.1034 テスターのふっぴーさん
ユーザー ikdikd
提出日時 2020-05-02 00:45:07
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 3,962 ms
コンパイル使用メモリ 166,032 KB
実行使用メモリ 26,788 KB
最終ジャッジ日時 2023-08-26 18:35:24
合計ジャッジ時間 7,504 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
22,700 KB
testcase_01 AC 79 ms
22,696 KB
testcase_02 AC 79 ms
22,760 KB
testcase_03 AC 79 ms
22,768 KB
testcase_04 AC 79 ms
24,732 KB
testcase_05 AC 78 ms
22,716 KB
testcase_06 AC 79 ms
24,760 KB
testcase_07 AC 79 ms
22,800 KB
testcase_08 AC 79 ms
24,772 KB
testcase_09 AC 79 ms
22,764 KB
testcase_10 AC 77 ms
22,768 KB
testcase_11 AC 79 ms
24,812 KB
testcase_12 AC 78 ms
24,736 KB
testcase_13 AC 79 ms
22,684 KB
testcase_14 AC 78 ms
22,784 KB
testcase_15 AC 78 ms
22,848 KB
testcase_16 AC 78 ms
20,648 KB
testcase_17 AC 78 ms
22,740 KB
testcase_18 AC 77 ms
22,688 KB
testcase_19 AC 80 ms
22,704 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(21,13): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _; _|]' may indicate a case not covered by the pattern(s).

ソースコード

diff #

// Learn more about F# at http://fsharp.org

open System

let solve n i j =
    let k = [i; n - i - 1; j; n - j - 1] |> List.min
    k * 4 * (n - k) + 
        if i = k then
            j - k
        elif j = n - k - 1 then
            n - k * 2 - 1 + i - k
        elif i = n - k - 1 then
            (n - k * 2 - 1) * 2 + n - k - 1 - j
        else
            (n - k * 2 - 1) * 3 + n - k - 1 - i

[<EntryPoint>]
let main argv =
    let q = stdin.ReadLine() |> int
    for _ = 1 to q do
        let [|n; i; j|] = stdin.ReadLine().Split() |> Array.map int
        printfn "%d" (solve n i j)
    0 // return an integer exit code
0