結果
| 問題 | No.185 和風 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-27 20:49:11 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 310 bytes |
| 記録 | |
| コンパイル時間 | 1,292 ms |
| コンパイル使用メモリ | 180,188 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-05-12 06:09:13 |
| 合計ジャッジ時間 | 2,763 ms |
|
ジャッジサーバーID (参考情報) |
tmp-judge_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}