結果
| 問題 | No.185 和風 |
| コンテスト | |
| ユーザー |
tenten
|
| 提出日時 | 2020-11-10 17:25:36 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 112 ms / 1,000 ms |
| + 330µs | |
| コード長 | 524 bytes |
| 記録 | |
| コンパイル時間 | 1,284 ms |
| コンパイル使用メモリ | 83,688 KB |
| 実行使用メモリ | 47,888 KB |
| 最終ジャッジ日時 | 2026-08-23 11:01:40 |
| 合計ジャッジ時間 | 3,079 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int ans = -(sc.nextInt() - sc.nextInt());
if (ans <= 0) {
System.out.println(-1);
return;
}
for (int i = 1; i < n; i++) {
if (ans != -(sc.nextInt() - sc.nextInt())) {
System.out.println(-1);
return;
}
}
System.out.println(ans);
}
}
tenten