結果

問題 No.185 和風
コンテスト
ユーザー pluto77
提出日時 2016-02-25 16:30:53
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
AC  
実行時間 71 ms / 1,000 ms
+ 517µs
コード長 293 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 78 ms
コンパイル使用メモリ 62,828 KB
実行使用メモリ 64,136 KB
最終ジャッジ日時 2026-11-12 12:15:15
合計ジャッジ時間 2,174 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#coding: utf-8
##yuki_185
import sys

n=int(raw_input())

for i in xrange(n):
 s=map(int,raw_input().split())
 x=s[0]
 y=s[1]
 if i==0:
  if y-x>0:
   temp=y-x
  else:
   print -1
   sys.exit()
 else:
  if y-x>0 and temp==y-x:
   continue
  else:
   print -1
   sys.exit()

res=temp
print res
0