結果
| 問題 | No.1120 Strange Teacher |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-25 11:35:06 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 273 bytes |
| 記録 | |
| コンパイル時間 | 119 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 80,196 KB |
| 最終ジャッジ日時 | 2024-06-27 01:11:26 |
| 合計ジャッジ時間 | 19,982 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 WA * 16 |
ソースコード
import numpy as np
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ab = []
for a,b in zip(A,B):
ab.append(abs(a-b))
ab = list(set(ab))
x = np.gcd.reduce(ab)
if x == 1 and ab!=[1]:
print(-1)
else:
print(np.lcm.reduce(ab))