結果
問題 |
No.185 和風
|
ユーザー |
![]() |
提出日時 | 2015-12-19 00:05:01 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 299 bytes |
コンパイル時間 | 422 ms |
コンパイル使用メモリ | 54,408 KB |
実行使用メモリ | 6,940 KB |
最終ジャッジ日時 | 2024-09-16 08:42:44 |
合計ジャッジ時間 | 910 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 = 1; i < n; i++){ cin >> y >> x; if(check != y - x || check < 1){ cout << -1 << endl; return 0; } } cout << (check < 1 ? -1 : check) << endl; return 0; }