結果
問題 | No.1120 Strange Teacher |
ユーザー |
![]() |
提出日時 | 2020-07-22 22:05:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 403 bytes |
コンパイル時間 | 888 ms |
コンパイル使用メモリ | 82,424 KB |
実行使用メモリ | 103,712 KB |
最終ジャッジ日時 | 2024-06-22 18:09:46 |
合計ジャッジ時間 | 3,629 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 2 RE * 3 |
ソースコード
n = int(input())a = list(map(int, input().split()))b = list(map(int, input().split()))diff = 0for i in range(n):diff += a[i] - b[i]if diff % (n - 2) == 0 and diff // (n - 2) > 0:cnt = diff // (n - 2)else:print(-1)exit()for i in range(n):d = cnt - (a[i] - b[i])if d % 2 == 0 and d >= 0:continueelse:print(-1)exit()print(cnt)