結果

問題 No.851 テストケース
ユーザー AtriaAtria
提出日時 2019-11-13 11:27:37
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 25 ms / 3,153 ms
コード長 1,164 bytes
コンパイル時間 752 ms
コンパイル使用メモリ 109,212 KB
実行使用メモリ 24,020 KB
最終ジャッジ日時 2023-10-21 19:40:39
合計ジャッジ時間 2,036 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
24,020 KB
testcase_01 AC 24 ms
24,020 KB
testcase_02 AC 22 ms
23,944 KB
testcase_03 AC 23 ms
24,020 KB
testcase_04 AC 25 ms
24,020 KB
testcase_05 AC 25 ms
24,020 KB
testcase_06 AC 24 ms
24,020 KB
testcase_07 AC 23 ms
24,020 KB
testcase_08 AC 23 ms
24,020 KB
testcase_09 AC 24 ms
24,020 KB
testcase_10 AC 24 ms
24,020 KB
testcase_11 AC 24 ms
24,020 KB
testcase_12 AC 24 ms
24,020 KB
testcase_13 AC 24 ms
24,020 KB
testcase_14 AC 24 ms
24,020 KB
testcase_15 AC 24 ms
24,020 KB
testcase_16 AC 25 ms
24,020 KB
testcase_17 AC 24 ms
24,020 KB
testcase_18 AC 25 ms
24,020 KB
testcase_19 AC 21 ms
23,944 KB
testcase_20 AC 22 ms
23,944 KB
testcase_21 AC 23 ms
24,020 KB
testcase_22 AC 23 ms
24,020 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.Linq;
using System.IO;
using System.Text;
using static System.Console;
using static System.Math;

namespace CP
{
    class Atria
    {
        static void Main(string[] args)
        {
            int n = int.Parse(ReadLine());
            try
            {
                var ls = new List<long>();
                for (int i = 0; i < n; i++)
                {
                    ls.Add(long.Parse(ReadLine()));
                }
                var hoge = new List<long>();
                hoge.Add(ls[0] + ls[1]);
                hoge.Add(ls[2] + ls[1]);
                hoge.Add(ls[0] + ls[2]);
                hoge.Sort();
                if (hoge[0] == hoge[1])
                {
                    WriteLine(hoge[1]);
                }
                else if (hoge[1] == hoge[2])
                {
                    WriteLine(hoge[0]);
                }
                else
                {
                    WriteLine(hoge[1]);
                }
            }
            catch (Exception)
            {
                WriteLine('"' + "assert" + '"');
            }
        }
    }
}
0