結果

問題 No.851 テストケース
ユーザー curryudon08curryudon08
提出日時 2020-07-10 18:54:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 34 ms / 3,153 ms
コード長 858 bytes
コンパイル時間 763 ms
コンパイル使用メモリ 114,996 KB
実行使用メモリ 30,308 KB
最終ジャッジ日時 2024-04-19 11:10:20
合計ジャッジ時間 2,265 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
28,392 KB
testcase_01 AC 31 ms
26,300 KB
testcase_02 AC 25 ms
25,788 KB
testcase_03 AC 31 ms
26,556 KB
testcase_04 AC 31 ms
26,416 KB
testcase_05 AC 31 ms
26,416 KB
testcase_06 AC 33 ms
28,268 KB
testcase_07 AC 32 ms
28,340 KB
testcase_08 AC 34 ms
26,212 KB
testcase_09 AC 31 ms
26,344 KB
testcase_10 AC 30 ms
26,800 KB
testcase_11 AC 30 ms
28,268 KB
testcase_12 AC 30 ms
26,672 KB
testcase_13 AC 30 ms
26,176 KB
testcase_14 AC 31 ms
26,432 KB
testcase_15 AC 30 ms
28,132 KB
testcase_16 AC 31 ms
28,336 KB
testcase_17 AC 31 ms
28,132 KB
testcase_18 AC 31 ms
30,308 KB
testcase_19 AC 25 ms
26,040 KB
testcase_20 AC 24 ms
25,988 KB
testcase_21 AC 31 ms
26,428 KB
testcase_22 AC 31 ms
26,160 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;

namespace _0851
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());

            var items = new long[n];
            for(var i = 0; i < n; i++){
                var s = Console.ReadLine().Split();
                if(s.Length != 1){
                    Console.WriteLine("\"assert\"");
                    return;
                }

                items[i] = long.Parse(s[0]);
            }

            var x = new List<long>();
            x.Add(items[0] + items[1]);
            x.Add(items[0] + items[2]);
            x.Add(items[1] + items[2]);

            var h = new HashSet<long>(x);
            var ans = h.OrderByDescending(t => t).Skip(1).First();
            Console.WriteLine(ans);
        }
    }
}
0