結果

問題 No.185 和風
ユーザー zaichu
提出日時 2015-12-19 00:02:43
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 54,672 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-16 08:42:26
合計ジャッジ時間 947 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

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