結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
latte0119
|
| 提出日時 | 2015-04-27 00:18:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 291 bytes |
| コンパイル時間 | 1,241 ms |
| コンパイル使用メモリ | 163,020 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 03:16:27 |
| 合計ジャッジ時間 | 1,660 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
set<int>S;
for(int i=0;i<N;i++){
int x,y;
cin>>x>>y;
S.insert(y-x);
}
if(S.size()!=1||*(S.begin())<=0){
cout<<-1<<endl;
}
else cout<<*(S.begin())<<endl;
}
latte0119