結果

問題 No.149 碁石の移動
ユーザー qwrtpsfgqwrtpsfg
提出日時 2017-08-25 09:20:36
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 756 bytes
コンパイル時間 2,064 ms
コンパイル使用メモリ 103,856 KB
実行使用メモリ 26,012 KB
最終ジャッジ日時 2023-08-25 17:53:52
合計ジャッジ時間 3,952 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,900 KB
testcase_01 AC 59 ms
26,012 KB
testcase_02 AC 58 ms
21,956 KB
testcase_03 AC 58 ms
21,948 KB
testcase_04 AC 58 ms
19,760 KB
testcase_05 AC 59 ms
23,896 KB
testcase_06 AC 58 ms
21,856 KB
testcase_07 AC 58 ms
21,856 KB
testcase_08 AC 59 ms
23,968 KB
testcase_09 AC 57 ms
23,900 KB
testcase_10 AC 58 ms
21,916 KB
testcase_11 AC 59 ms
22,044 KB
testcase_12 AC 58 ms
21,880 KB
testcase_13 AC 58 ms
21,868 KB
testcase_14 AC 58 ms
23,872 KB
testcase_15 AC 58 ms
21,860 KB
testcase_16 AC 59 ms
23,960 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;
using System.Collections.Generic;

public class yukicoder
{
    public static void Main()
    {
        long[] a = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        long[] b = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        long[] c = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        
        //初回白持ってく数
        long move1 = c[0] - a[1];
        if(move1 <= 0) move1 = 0;
        a[0] -= move1;
        b[0] += move1;
        

        long move2 = 0;

        if(c[1] > b[0])
        {
            Console.WriteLine(a[0] + b[0]);
        }
        else
        {
            Console.WriteLine(a[0] + c[1]);
        }
    }
}
0