結果

問題 No.185 和風
コンテスト
ユーザー naoe123
提出日時 2020-01-14 18:53:57
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 22 ms / 1,000 ms
+ 286µs
コード長 350 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2026-10-11 08:14:16
合計ジャッジ時間 1,362 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N=int(input())
x = []
y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)

l=[]

for i in range(N):
    l.append(y[i]-x[i])

def multi_diff(es):
    return es == [es[0]] * len(es) if es else False

if multi_diff(l):
    if l[0]>0:
        print(l[0])
    else:
        print(-1)
else:
    print(-1)
0