結果
| 問題 | No.1120 Strange Teacher |
| コンテスト | |
| ユーザー |
takakin
|
| 提出日時 | 2020-07-25 21:52:45 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 470 bytes |
| 記録 | |
| コンパイル時間 | 61 ms |
| コンパイル使用メモリ | 14,848 KB |
| 実行使用メモリ | 24,812 KB |
| 最終ジャッジ日時 | 2026-10-13 15:58:08 |
| 合計ジャッジ時間 | 3,406 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 WA * 2 |
ソースコード
import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) A=[int(i) for i in input().split()] B=[int(i) for i in input().split()] if n==2: if sum(A)==sum(B): print(abs(A[0]-B[0])) else: print(-1) else: d=sum(A)-sum(B) if d<0 or d%(n-2)!=0: print(-1) else: ans=d//(n-2) ct=0 Chk=True for i in range(n): if (B[i]-A[i]+ans)%2!=0: Chk=False ct+=(B[i]-A[i]+ans)//2 if Chk==False or ct!=ans: print(-1) else: print(ans)
takakin