結果
| 問題 | No.1120 Strange Teacher |
| コンテスト | |
| ユーザー |
brthyyjp
|
| 提出日時 | 2020-08-02 01:38:22 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 407 bytes |
| 記録 | |
| コンパイル時間 | 294 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 104,448 KB |
| 最終ジャッジ日時 | 2026-03-30 16:19:43 |
| 合計ジャッジ時間 | 3,498 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 RE * 3 |
ソースコード
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
S = 0
for a, b in zip(A, B):
S += a-b
#print(S)
if S%(n-2) == 0:
x = S//(n-2)
for a, b in zip(A, B):
if b-a+x < 0:
print(-1)
exit()
else:
if (b-a+x)%2 != 0:
print(-1)
exit()
else:
print(x)
else:
print(-1)
brthyyjp