結果

問題 No.1120 Strange Teacher
ユーザー isacaisaca
提出日時 2020-07-25 11:30:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 215 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 45,656 KB
最終ジャッジ日時 2023-09-09 07:57:39
合計ジャッジ時間 9,372 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 132 ms
29,448 KB
testcase_10 AC 244 ms
45,356 KB
testcase_11 AC 241 ms
45,512 KB
testcase_12 AC 243 ms
45,656 KB
testcase_13 AC 243 ms
44,688 KB
testcase_14 AC 238 ms
44,748 KB
testcase_15 AC 227 ms
44,696 KB
testcase_16 AC 241 ms
44,424 KB
testcase_17 AC 224 ms
44,692 KB
testcase_18 AC 129 ms
29,388 KB
testcase_19 AC 216 ms
45,080 KB
testcase_20 AC 131 ms
29,496 KB
testcase_21 AC 131 ms
29,488 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 131 ms
29,352 KB
testcase_28 AC 129 ms
29,488 KB
testcase_29 AC 131 ms
29,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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))

x = np.lcm.reduce(ab)
print(-1 if x not in ab else x)
0