結果
問題 | No.1120 Strange Teacher |
ユーザー |
|
提出日時 | 2022-01-04 22:10:20 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 471 bytes |
コンパイル時間 | 215 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 103,680 KB |
最終ジャッジ日時 | 2024-10-15 00:50:16 |
合計ジャッジ時間 | 4,903 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 RE * 3 |
ソースコード
N = int(input())lsA = list(map(int,input().split()))lsB = list(map(int,input().split()))ls = []for i in range(N):ls.append(lsA[i]-lsB[i])if sum(ls) % (N-2) != 0:print(-1)exit()kai = sum(ls)//(N-2)for i in range(N):ls[i] -= kaicnt = 0for i in range(N):if ls[i] % 2 != 0:print(-1)exit()if ls[i] > 0:print(-1)exit()cnt += -ls[i]//2if cnt > kai:print(-1)exit()print(kai)