結果
問題 | No.185 和風 |
ユーザー | jimano |
提出日時 | 2018-01-13 19:19:51 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 450 bytes |
コンパイル時間 | 3,225 ms |
コンパイル使用メモリ | 71,524 KB |
実行使用メモリ | 60,408 KB |
最終ジャッジ日時 | 2023-08-25 15:59:12 |
合計ジャッジ時間 | 5,169 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 183 ms
56,128 KB |
testcase_01 | AC | 201 ms
60,408 KB |
testcase_02 | AC | 127 ms
55,800 KB |
testcase_03 | AC | 126 ms
56,028 KB |
testcase_04 | AC | 126 ms
55,864 KB |
testcase_05 | WA | - |
testcase_06 | AC | 198 ms
58,328 KB |
ソースコード
package me.yukicoder.lv1; import java.util.Scanner; public class No0185 { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { int N = sc.nextInt(); int x = sc.nextInt(); int y = sc.nextInt(); int ans = y - x; for (int i = 0; i < N - 1; i++) { x = sc.nextInt(); y = sc.nextInt(); if (ans != y - x || ans < 0) { ans = -1; break; } } System.out.println(ans); } } }