結果

問題 No.1120 Strange Teacher
ユーザー asumo0729
提出日時 2020-07-22 21:43:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 331 bytes
コンパイル時間 690 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,372 KB
最終ジャッジ日時 2024-06-22 14:59:06
合計ジャッジ時間 2,968 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

sabun=0
for x in range(n):
    c=b[x]-a[x]
    ans+=c
    
if n==2:
    if a[0]-b[0]==-1*(a[1]-b[0]):
        print(abs(a[0]-b[0]))
    else:
        print(-1)
        
else:
    if ans%(2-n)==0:
        print(ans//(2-n))
    else:
        print(-1)
0