結果

問題 No.1120 Strange Teacher
ユーザー brthyyjpbrthyyjp
提出日時 2020-08-02 01:38:22
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 407 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 101,340 KB
最終ジャッジ日時 2023-09-23 00:05:17
合計ジャッジ時間 7,348 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,492 KB
testcase_01 AC 74 ms
71,364 KB
testcase_02 AC 97 ms
75,600 KB
testcase_03 AC 81 ms
76,556 KB
testcase_04 AC 117 ms
101,076 KB
testcase_05 AC 116 ms
101,148 KB
testcase_06 AC 117 ms
101,224 KB
testcase_07 AC 116 ms
101,148 KB
testcase_08 AC 114 ms
101,340 KB
testcase_09 AC 72 ms
71,376 KB
testcase_10 AC 110 ms
101,108 KB
testcase_11 AC 113 ms
101,076 KB
testcase_12 AC 111 ms
101,152 KB
testcase_13 AC 112 ms
101,176 KB
testcase_14 AC 112 ms
101,156 KB
testcase_15 AC 111 ms
101,048 KB
testcase_16 AC 115 ms
101,088 KB
testcase_17 AC 111 ms
101,144 KB
testcase_18 AC 70 ms
71,500 KB
testcase_19 AC 112 ms
99,692 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 69 ms
71,380 KB
testcase_23 AC 69 ms
71,388 KB
testcase_24 AC 110 ms
100,528 KB
testcase_25 RE -
testcase_26 AC 71 ms
71,012 KB
testcase_27 AC 70 ms
71,416 KB
testcase_28 AC 70 ms
71,408 KB
testcase_29 AC 70 ms
71,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

S = 0
for a, b in zip(A, B):
    S += a-b
#print(S)
if S%(n-2) == 0:
    x = S//(n-2)
    for a, b in zip(A, B):
        if b-a+x < 0:
            print(-1)
            exit()
        else:
            if (b-a+x)%2 != 0:
                print(-1)
                exit()
    else:
        print(x)
else:
    print(-1)
0