結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
Yut176
|
| 提出日時 | 2016-08-05 22:14:28 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 541 bytes |
| コンパイル時間 | 534 ms |
| コンパイル使用メモリ | 66,588 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 00:20:02 |
| 合計ジャッジ時間 | 1,012 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<stdlib.h>
#include<vector>
#include<string>
#include<sstream>
#include<math.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> x(n);
vector<int> y(n);
for(int i=0;i<n;i++){
cin >> x[i] >> y[i];
}
int ans = y[0] - x[0];
if(ans <= 0) {
cout << -1 << endl;
return 0;
}
for(int i=1;i<n;i++){
int tmp = y[i]-x[i];
if(ans != tmp) {
cout << -1 << endl;
return 0;
}
}
cout << ans << endl;
return 0;
}
Yut176