結果
問題 | No.185 和風 |
ユーザー |
![]() |
提出日時 | 2015-12-19 00:06:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 286 bytes |
コンパイル時間 | 491 ms |
コンパイル使用メモリ | 53,588 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-16 08:43:33 |
合計ジャッジ時間 | 961 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
#include <iostream> using namespace std; int main(){ int n; cin >> n; int x,y; cin >> x >> y; int check = y - x; for(int i = 1; i < n; i++){ cin >> x >> y; if(check != y - x){ cout << -1 << endl; return 0; } } cout << (check < 1 ? -1 : check) << endl; return 0; }