結果
問題 | No.1120 Strange Teacher |
ユーザー |
![]() |
提出日時 | 2020-07-24 21:28:38 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 414 bytes |
コンパイル時間 | 335 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 103,040 KB |
最終ジャッジ日時 | 2024-06-25 20:33:40 |
合計ジャッジ時間 | 4,541 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 WA * 2 RE * 2 |
ソースコード
import sysinput = sys.stdin.readlineN = int(input())A = list(map(int, input().split()))B = list(map(int, input().split()))C = [B[i]-A[i] for i in range(N)]D = []for i in range(1, N):if (C[0]-C[i])%2==1:print(-1)exit()D.append((C[0]-C[i])//2)S = sum(D)if (S-C[0])%(N-2)!=0:print(-1)exit()x = (S-C[0])//(N-2)ans = xfor Di in D:ans += x-Diprint(ans)