結果
問題 | No.185 和風 |
ユーザー | curryudon08 |
提出日時 | 2020-06-18 15:59:02 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 549 bytes |
コンパイル時間 | 3,588 ms |
コンパイル使用メモリ | 103,944 KB |
実行使用メモリ | 21,524 KB |
最終ジャッジ日時 | 2023-09-16 12:08:02 |
合計ジャッジ時間 | 3,072 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 60 ms
21,524 KB |
testcase_01 | AC | 61 ms
21,524 KB |
testcase_02 | AC | 61 ms
21,456 KB |
testcase_03 | AC | 61 ms
21,468 KB |
testcase_04 | AC | 61 ms
21,464 KB |
testcase_05 | WA | - |
testcase_06 | AC | 61 ms
21,524 KB |
コンパイルメッセージ
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; namespace _0185 { class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var d = new int[n]; for(var i = 0; i < n; i++){ var _ = Console.ReadLine().Split(); var x = int.Parse(_[0]); var y = int.Parse(_[1]); d[i] = y - x; } var f = d.First(); Console.WriteLine(d.All(x => x == f) && f >= 0 ? f : -1); } } }