結果

問題 No.1120 Strange Teacher
ユーザー ytftytft
提出日時 2021-05-07 08:41:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 372 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 101,512 KB
最終ジャッジ日時 2023-10-12 23:48:00
合計ジャッジ時間 6,556 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
70,924 KB
testcase_01 AC 71 ms
71,224 KB
testcase_02 AC 77 ms
75,464 KB
testcase_03 AC 77 ms
76,312 KB
testcase_04 AC 113 ms
101,084 KB
testcase_05 AC 112 ms
100,728 KB
testcase_06 AC 113 ms
100,788 KB
testcase_07 AC 111 ms
101,052 KB
testcase_08 AC 112 ms
100,676 KB
testcase_09 AC 70 ms
70,924 KB
testcase_10 AC 111 ms
101,044 KB
testcase_11 AC 110 ms
100,920 KB
testcase_12 AC 109 ms
100,928 KB
testcase_13 AC 109 ms
101,056 KB
testcase_14 AC 108 ms
100,816 KB
testcase_15 AC 109 ms
100,728 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 70 ms
71,216 KB
testcase_19 AC 111 ms
99,232 KB
testcase_20 AC 70 ms
71,060 KB
testcase_21 AC 68 ms
71,248 KB
testcase_22 AC 69 ms
71,112 KB
testcase_23 AC 69 ms
70,928 KB
testcase_24 AC 106 ms
100,128 KB
testcase_25 AC 68 ms
71,188 KB
testcase_26 AC 70 ms
71,032 KB
testcase_27 AC 71 ms
71,072 KB
testcase_28 AC 70 ms
71,288 KB
testcase_29 AC 67 ms
71,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
flg=0
if N==2:
    if sum(A)==sum(B):
        flg=1
        time=abs(A[0]-B[0])
else:
    if (sum(A)-sum(B))%(N-2)==0:
        time=(sum(A)-sum(B))//(N-2)
        flg=1
        for i in range(N):
            if (A[i]-B[i]+time)%2==1:
                flg=0
print(time if flg else -1)
        
0