結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
cureskol
|
| 提出日時 | 2020-03-22 14:54:36 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 251 bytes |
| コンパイル時間 | 2,054 ms |
| コンパイル使用メモリ | 170,524 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-24 17:36:02 |
| 合計ジャッジ時間 | 2,334 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
signed main(){
int n;cin>>n;
set<int> s;
while(n--){
int a,b;cin>>a>>b;
s.insert(b-a);
}
if(s.size()>1||*s.begin()<=0)cout<<-1<<endl;
else cout<<*s.begin()<<endl;
}
cureskol