結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
かぼちゃ
|
| 提出日時 | 2018-04-07 18:15:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 385 bytes |
| コンパイル時間 | 457 ms |
| コンパイル使用メモリ | 59,128 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 11:05:33 |
| 合計ジャッジ時間 | 887 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
long long x,y,dif;
cin >> x >> y;
dif = y - x;
dif = dif <= 0 ? -1 : dif;
for(int i = 1;i < n;i++){
cin >> x >> y;
if(dif != y - x){
dif = -1;
break;
}
}
cout << dif << endl;
return 0;
}
かぼちゃ