結果

問題 No.149 碁石の移動
ユーザー 14番14番
提出日時 2016-04-20 01:29:21
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 1,969 bytes
コンパイル時間 3,258 ms
コンパイル使用メモリ 104,300 KB
実行使用メモリ 22,792 KB
最終ジャッジ日時 2023-08-25 17:44:01
合計ジャッジ時間 4,820 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,772 KB
testcase_01 AC 56 ms
20,740 KB
testcase_02 AC 57 ms
22,720 KB
testcase_03 AC 57 ms
20,620 KB
testcase_04 AC 58 ms
20,628 KB
testcase_05 AC 58 ms
20,680 KB
testcase_06 AC 57 ms
20,732 KB
testcase_07 AC 56 ms
20,684 KB
testcase_08 AC 58 ms
22,776 KB
testcase_09 AC 56 ms
20,736 KB
testcase_10 AC 56 ms
20,748 KB
testcase_11 AC 57 ms
22,748 KB
testcase_12 AC 56 ms
20,772 KB
testcase_13 AC 56 ms
22,760 KB
testcase_14 AC 57 ms
22,712 KB
testcase_15 AC 57 ms
22,784 KB
testcase_16 AC 57 ms
22,792 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.Collections.Generic;
using System.Text;
using System.Linq;
 
class Program
{
    public void Proc()
    {
        Reader.IsDebug = false;
        int[] inpt = Reader.GetInt();
        
        int aW = inpt[0];
        int aB = inpt[1];
        
        inpt = Reader.GetInt();
        int bW = inpt[0];
        int bB = inpt[1];
        
        inpt = Reader.GetInt();
        int c = inpt[0];
        int d = inpt[1];
        
        if(aB > c) {
            bB += c;
            aB -= c;
        } else
        {
            bW += (c-aB);
            aW -= (c-aB);
            bB += aB;
            aB = 0;
        }
        if(bW > d) {
            aW += d;
        } else
        {
            aW += bW;
        }
        Console.WriteLine(aW);
        
    }

    public class Reader
    {
        public static bool IsDebug = true;
        private static String PlainInput = @"


43682 82641
54647 3647
92674 64591


 
";
        private static System.IO.StringReader Sr = null;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (Sr == null)
                {
                    Sr = new System.IO.StringReader(PlainInput.Trim());
                }
                return Sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
        public static int[] GetInt(char delimiter = ' ', bool trim = false)
        {
            string inptStr = ReadLine();
            if (trim)
            {
                inptStr = inptStr.Trim();
            }
            string[] inpt = inptStr.Split(delimiter);
            int[] ret = new int[inpt.Length];
            for (int i = 0; i < inpt.Length; i++)
            {
                ret[i] = int.Parse(inpt[i]);
            }
            return ret;
        }
    }
    static void Main()
    {
        Program prg = new Program();
        prg.Proc();
    }
}
0