結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-04 21:49:07 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 244 bytes |
| コンパイル時間 | 985 ms |
| コンパイル使用メモリ | 53,848 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 19:00:51 |
| 合計ジャッジ時間 | 989 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include <iostream>
using namespace std;
int main(){
int n;
int q=-1;
cin>>n;
for(int i=0;i<n;++i){
int x,y;
cin>>x>>y;
if(x >= y) {
cout<<-1<<endl;return 0;
}
if(i==0){
q=y-x;
}else{
if(q!=y-x) {
cout<<-1<<endl;return 0;
}
}}
cout<<q<<endl;
}