結果

問題 No.149 碁石の移動
ユーザー しらゆきしらゆき
提出日時 2015-11-20 09:46:53
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 739 bytes
コンパイル時間 3,148 ms
コンパイル使用メモリ 103,296 KB
実行使用メモリ 23,908 KB
最終ジャッジ日時 2023-08-25 17:41:23
合計ジャッジ時間 5,140 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,852 KB
testcase_01 AC 60 ms
21,844 KB
testcase_02 AC 59 ms
21,944 KB
testcase_03 AC 59 ms
21,788 KB
testcase_04 AC 60 ms
23,708 KB
testcase_05 AC 59 ms
19,692 KB
testcase_06 AC 60 ms
23,880 KB
testcase_07 AC 59 ms
21,816 KB
testcase_08 AC 59 ms
21,812 KB
testcase_09 AC 60 ms
23,728 KB
testcase_10 AC 59 ms
21,828 KB
testcase_11 AC 61 ms
21,816 KB
testcase_12 AC 60 ms
23,796 KB
testcase_13 AC 60 ms
23,908 KB
testcase_14 AC 59 ms
21,832 KB
testcase_15 AC 60 ms
21,892 KB
testcase_16 AC 61 ms
21,928 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

class Program
{
    static void Main()
    {
        int[] i = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int[] j = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int[] k = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int aw = i[0];
        int ab = i[1];
        int bw = j[0];
        int bb = j[1];
        int c = k[0];
        int d = k[1];

        if (c > ab)
        {
            aw -= c - ab;
            bw += c - ab;
            bb += ab;
            ab = 0;
        }
        else
        {
            ab -= c;
            bb += c;
        }

        if (bw > d) aw += d;
        else aw += bw;

        Console.WriteLine(aw);
    }
}
0