結果

問題 No.1034 テスターのふっぴーさん
ユーザー ikdikd
提出日時 2020-05-02 00:49:02
言語 F#
(F# 4.0)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 647 bytes
コンパイル時間 6,035 ms
コンパイル使用メモリ 164,136 KB
実行使用メモリ 24,860 KB
最終ジャッジ日時 2023-08-26 18:42:18
合計ジャッジ時間 9,301 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
20,704 KB
testcase_01 AC 88 ms
22,860 KB
testcase_02 AC 88 ms
22,740 KB
testcase_03 AC 88 ms
24,812 KB
testcase_04 AC 87 ms
24,808 KB
testcase_05 AC 88 ms
22,736 KB
testcase_06 AC 87 ms
20,708 KB
testcase_07 AC 87 ms
22,852 KB
testcase_08 AC 87 ms
24,768 KB
testcase_09 AC 86 ms
22,912 KB
testcase_10 AC 87 ms
22,812 KB
testcase_11 AC 88 ms
22,744 KB
testcase_12 AC 88 ms
22,732 KB
testcase_13 AC 89 ms
22,736 KB
testcase_14 AC 88 ms
22,724 KB
testcase_15 AC 89 ms
22,752 KB
testcase_16 AC 88 ms
24,784 KB
testcase_17 AC 87 ms
22,732 KB
testcase_18 AC 89 ms
22,856 KB
testcase_19 AC 87 ms
24,796 KB
testcase_20 AC 90 ms
24,800 KB
testcase_21 AC 90 ms
20,916 KB
testcase_22 AC 89 ms
22,732 KB
testcase_23 AC 89 ms
24,784 KB
testcase_24 AC 90 ms
24,860 KB
testcase_25 AC 87 ms
20,864 KB
testcase_26 AC 89 ms
22,700 KB
testcase_27 AC 89 ms
22,784 KB
testcase_28 AC 88 ms
24,752 KB
testcase_29 AC 88 ms
24,840 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(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 - 1L; j; n - j - 1L] |> List.min
    k * 4L * (n - k) + 
        if i = k then
            j - k
        elif j = n - k - 1L then
            n - k * 2L - 1L + i - k
        elif i = n - k - 1L then
            (n - k * 2L - 1L) * 2L + n - k - 1L - j
        else
            (n - k * 2L - 1L) * 3L + n - k - 1L - i

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