結果

問題 No.149 碁石の移動
ユーザー kuuso1kuuso1
提出日時 2016-08-18 19:03:24
言語 F#
(F# 4.0)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 717 bytes
コンパイル時間 5,348 ms
コンパイル使用メモリ 171,128 KB
実行使用メモリ 24,836 KB
最終ジャッジ日時 2023-08-25 17:47:03
合計ジャッジ時間 6,537 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
22,772 KB
testcase_01 AC 76 ms
22,772 KB
testcase_02 AC 73 ms
22,636 KB
testcase_03 AC 71 ms
22,804 KB
testcase_04 AC 72 ms
22,788 KB
testcase_05 AC 72 ms
22,920 KB
testcase_06 AC 74 ms
24,808 KB
testcase_07 AC 75 ms
22,760 KB
testcase_08 AC 74 ms
22,636 KB
testcase_09 AC 73 ms
22,648 KB
testcase_10 AC 72 ms
22,832 KB
testcase_11 AC 77 ms
24,836 KB
testcase_12 AC 74 ms
22,820 KB
testcase_13 AC 75 ms
24,740 KB
testcase_14 AC 77 ms
22,792 KB
testcase_15 AC 75 ms
22,808 KB
testcase_16 AC 76 ms
22,832 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(6,13): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _|]' may indicate a case not covered by the pattern(s).

ソースコード

diff #

open System
type Sol() =
    member this.Solve() = 
        let A = stdin.ReadLine().Split() |> Array.map int
        let B = stdin.ReadLine().Split() |> Array.map int
        let [|C;D|] = stdin.ReadLine().Split() |> Array.map int
        
        let rmB = if C > A.[1] then A.[1] else C
        let rmW = (C - rmB)
        A.[0] <- A.[0] - rmW
        A.[1] <- A.[1] - rmB
        B.[0] <- B.[0] + rmW
        B.[1] <- B.[1] + rmB
        
        let rmW = if D > B.[0] then B.[0] else D
        let rmB = (D - rmW)
        B.[0] <- B.[0] - rmW
        B.[1] <- B.[1] - rmB
        A.[0] <- A.[0] + rmW
        A.[1] <- A.[1] + rmB
        
        printfn "%d" A.[0]
        
let mySol = new Sol()
mySol.Solve()
0