結果

問題 No.920 あかあお
ユーザー cccccc
提出日時 2022-08-27 20:50:43
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 866 bytes
コンパイル時間 11,477 ms
コンパイル使用メモリ 166,884 KB
実行使用メモリ 184,676 KB
最終ジャッジ日時 2024-04-22 17:59:33
合計ジャッジ時間 12,023 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 54 ms
29,952 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 54 ms
30,080 KB
testcase_11 WA -
testcase_12 AC 54 ms
29,952 KB
testcase_13 AC 55 ms
184,676 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (91 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using System.IO;
using System.Linq;

namespace ConsoleApp4
{
    class Program
    {
        static void Main()
        {
            var N = Console.ReadLine().Split().Select(int.Parse).ToArray();
            if (N.Contains(0))
            {
                Console.WriteLine(0);
            }
            else
            {
                var x = N[0];
                var y = N[1];
                var z = N[2];

                var a = (Math.Abs(x - y) - N[2]) / 2;
                var b = Math.Abs(a);

                if ((b + Math.Min(x, y)) == Math.Max(x, y))
                {
                    var max = Math.Max(x, y);
                    Console.WriteLine(b + max);
                }
                else
                {
                    Console.WriteLine(Math.Min(x, y) + N[2]);
                }

            }


        }
    }
}
0