結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-27 20:49:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 310 bytes |
| コンパイル時間 | 1,364 ms |
| コンパイル使用メモリ | 161,608 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-17 04:56:40 |
| 合計ジャッジ時間 | 1,841 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,ans;
cin>>n;
vector<int> a(n);
for(int i=0;i<n;++i){
int x,y;
cin>>x>>y;
a[i]=y-x;
}
a.erase(unique(a.begin(),a.end()),a.end());
ans=(a.size()>1||a.front()<1?-1:a.front());
cout<<ans<<endl;
}