結果
問題 | No.185 和風 |
ユーザー |
![]() |
提出日時 | 2019-09-18 08:37:34 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 28 ms / 1,000 ms |
コード長 | 387 bytes |
コンパイル時間 | 107 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-07-07 19:56:20 |
合計ジャッジ時間 | 819 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
# No.185 和風 n = int(input()) x = [0] * n y = [0] * n for i in range(n): x[i], y[i] = [int(j) for j in input().split()] is_equal = True answer = y[0] - x[0] if answer <= 0: print(-1) elif n == 1: print(answer) else: for i in range(1, n): if y[i] - x[i] != answer: is_equal = False break print(answer if is_equal else -1)