結果

問題 No.185 和風
ユーザー motor_radialmotor_radial
提出日時 2019-07-29 16:42:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 260 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 7,936 KB
最終ジャッジ日時 2023-09-15 11:57:14
合計ジャッジ時間 799 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,936 KB
testcase_01 AC 18 ms
7,880 KB
testcase_02 AC 18 ms
7,824 KB
testcase_03 AC 20 ms
7,816 KB
testcase_04 AC 19 ms
7,748 KB
testcase_05 WA -
testcase_06 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
X=[0]*N
Y=[0]*N
cnt=0
for _ in range(N):
    X[_],Y[_]=list(map(int,input().split()))
k=Y[0]-X[0]
if 0<=k and k<=N:
    for i in range(N):
        cnt+=(Y[i]-X[i])
    if cnt==k*N:
        print(k)
    else:
        print(-1)
else:
    print(-1)
0