結果

問題 No.185 和風
ユーザー startcpp
提出日時 2015-08-14 23:08:07
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 251 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 53,472 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-18 09:30:38
合計ジャッジ時間 794 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int n;
int x, y;

int main() {
cin >> n >> x >> y;
int ans = y - x;
for (int i = 1; i < n; i++) {
cin >> x >> y;
if (ans != y - x || ans < 0) {
cout << -1 << endl;
return 0;
}
}
cout << ans << endl;
return 0;
}
0