結果
問題 | No.185 和風 |
ユーザー | misk703 |
提出日時 | 2018-05-14 12:41:00 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 522 bytes |
コンパイル時間 | 4,871 ms |
コンパイル使用メモリ | 74,344 KB |
実行使用メモリ | 58,628 KB |
最終ジャッジ日時 | 2023-09-10 19:45:40 |
合計ジャッジ時間 | 6,335 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 190 ms
55,876 KB |
testcase_01 | AC | 210 ms
58,376 KB |
testcase_02 | AC | 205 ms
58,628 KB |
testcase_03 | AC | 205 ms
58,044 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 208 ms
58,144 KB |
ソースコード
import java.util.ArrayList; import java.util.Scanner; public class Wahu { public static void main(String[] args) { Scanner s = new Scanner(System.in); int N = Integer.parseInt(s.nextLine()); ArrayList<Integer> list = new ArrayList<>(); for(int i=0;i<N;i++){ int a = s.nextInt(); int b = s.nextInt(); list.add(b-a); } int buff = list.get(0); for(int i=1;i<list.size();i++){ if(buff != list.get(i)){ System.out.println(-1); return; } } System.out.println(buff); return; } }