結果
問題 |
No.178 美しいWhitespace (1)
|
ユーザー |
![]() |
提出日時 | 2019-04-14 12:16:15 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 600 bytes |
コンパイル時間 | 954 ms |
コンパイル使用メモリ | 114,016 KB |
実行使用メモリ | 27,064 KB |
最終ジャッジ日時 | 2024-09-18 18:06:33 |
合計ジャッジ時間 | 3,082 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 7 RE * 14 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; public class Program { public static void Main() { var count = int.Parse(Console.ReadLine()); var inputs = new List<int>(); for (var i = 0; i < count; i++){ var l = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToList(); inputs.Add(l[0] + l[1] * 4); } if (inputs.All(x => x % 2 == inputs.Max() % 2)) Console.Write("{0}", inputs.Sum(x => inputs.Max() - x) / 2); else Console.Write("{0}", -1); return; } }