結果
問題 | No.185 和風 |
ユーザー |
![]() |
提出日時 | 2015-07-09 02:35:18 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 313 bytes |
コンパイル時間 | 435 ms |
コンパイル使用メモリ | 54,528 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-08 01:46:09 |
合計ジャッジ時間 | 736 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
#include<iostream> using namespace std; int main(void){ int x, y, n; cin >> n >> x >> y; int ans = y - x; if (ans <= 0) { cout << -1 << endl; return 0; } for (int i = 0; i < n-1; i++){ cin >> x >> y; if (y - x != ans || y - x <= 0) { cout << -1 << endl; return 0; } } cout << ans << endl; return 0; }