結果

問題 No.851 テストケース
ユーザー bluemegane
提出日時 2021-05-20 18:37:19
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 3,153 ms
コード長 728 bytes
コンパイル時間 794 ms
コンパイル使用メモリ 104,192 KB
実行使用メモリ 18,048 KB
最終ジャッジ日時 2024-10-10 07:17:50
合計ジャッジ時間 2,101 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Collections.Generic;
using System;

public class Hello
{
    static void Main()
    {
        Console.ReadLine();
        var a = new long[3];
        var ok = true;
        for (int i = 0; i < 3; i++)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            if (line.Length > 1) { Console.WriteLine(@"""assert"""); ok = false; break; }
            a[i] = long.Parse(line[0]);
        }
        if (ok)
        {
            var b = new List<long>();
            b.Add(a[0] + a[1]);
            b.Add(a[1] + a[2]);
            b.Add(a[2] + a[0]);
            b.Sort();
            if (b[1] == b[2]) Console.WriteLine(b[0]);
            else Console.WriteLine(b[1]);
        }
    }
}
0