結果
問題 |
No.185 和風
|
ユーザー |
![]() |
提出日時 | 2015-12-19 00:01:07 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 280 bytes |
コンパイル時間 | 379 ms |
コンパイル使用メモリ | 55,472 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-16 08:42:25 |
合計ジャッジ時間 | 800 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 2 |
ソースコード
#include <iostream> using namespace std; int main(){ int n; cin >> n; int x,y; cin >> x >> y; int check = y - x; for(int i = 0; i < n - 1; i++){ cin >> y >> x; if(check != y - x){ check = -1; break; } } cout << (check <= 0 ? -1 : check) << endl; return 0; }