結果

問題 No.185 和風
ユーザー kotatsugame
提出日時 2016-12-21 17:06:57
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 529 ms
コンパイル使用メモリ 64,344 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 12:27:34
合計ジャッジ時間 1,055 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main() {
	int n;cin>>n;
	int a,b,c=-1;
	for(int i=0;i<n;i++)
	{
		cin>>a>>b;
		if(c==-1)c=b-a;
		else if(c!=b-a){cout<<-1<<endl;return 0;}
		if(c<0){cout<<-1<<endl;return 0;}
	}
	cout<<c<<endl;
}
0