結果
問題 | No.851 テストケース |
ユーザー |
|
提出日時 | 2020-07-10 18:54:49 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 36 ms / 3,153 ms |
コード長 | 858 bytes |
コンパイル時間 | 2,692 ms |
コンパイル使用メモリ | 112,960 KB |
実行使用メモリ | 28,640 KB |
最終ジャッジ日時 | 2024-10-11 03:27:04 |
合計ジャッジ時間 | 2,656 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.
ソースコード
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); } } }