結果

問題 No.1120 Strange Teacher
ユーザー now4estnow4est
提出日時 2020-07-23 12:52:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 268 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 39,296 KB
最終ジャッジ日時 2023-09-05 22:09:54
合計ジャッジ時間 6,500 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
29,700 KB
testcase_01 AC 133 ms
29,784 KB
testcase_02 AC 131 ms
29,816 KB
testcase_03 AC 135 ms
30,816 KB
testcase_04 AC 187 ms
38,516 KB
testcase_05 AC 181 ms
38,568 KB
testcase_06 AC 178 ms
38,480 KB
testcase_07 AC 178 ms
38,612 KB
testcase_08 AC 177 ms
38,504 KB
testcase_09 AC 130 ms
29,700 KB
testcase_10 AC 187 ms
39,296 KB
testcase_11 AC 185 ms
39,272 KB
testcase_12 AC 186 ms
39,288 KB
testcase_13 AC 178 ms
38,684 KB
testcase_14 AC 178 ms
38,516 KB
testcase_15 AC 175 ms
38,528 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 130 ms
29,736 KB
testcase_19 AC 180 ms
38,936 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 130 ms
29,736 KB
testcase_23 AC 132 ms
29,716 KB
testcase_24 AC 178 ms
38,864 KB
testcase_25 AC 134 ms
29,680 KB
testcase_26 AC 132 ms
29,672 KB
testcase_27 AC 130 ms
29,752 KB
testcase_28 AC 133 ms
29,716 KB
testcase_29 AC 129 ms
29,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N = int(input())
A = np.array(input().split(), dtype=np.int64)
B = np.array(input().split(), dtype=np.int64)

ans = -1
v = (A.sum() - B.sum()) / (N - 2)

if ((B - A + v) % 2 == 0).all() and ((B - A + v) / 2).sum() == v:
    ans = int(v)

print(ans)
0