結果
問題 | No.185 和風 |
ユーザー | Crowea |
提出日時 | 2019-01-26 14:05:50 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 641 bytes |
コンパイル時間 | 1,370 ms |
コンパイル使用メモリ | 68,168 KB |
実行使用メモリ | 22,812 KB |
最終ジャッジ日時 | 2023-10-14 10:10:00 |
合計ジャッジ時間 | 2,274 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | AC | 61 ms
20,676 KB |
testcase_02 | AC | 63 ms
22,740 KB |
testcase_03 | AC | 60 ms
22,620 KB |
testcase_04 | AC | 62 ms
22,608 KB |
testcase_05 | AC | 61 ms
22,812 KB |
testcase_06 | RE | - |
ソースコード
using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { var N = int.Parse(Console.ReadLine()); var set = new HashSet<int>(); int[] input; int ans = 0; while (N > 0) { input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); input[1] -= input[0]; if (input[1] <= 0) { Console.WriteLine(-1); return; } if (ans == 0) ans = input[1]; else if (ans != input[1]) { Console.WriteLine("-1"); return; } } Console.WriteLine(ans); } }