結果
問題 | No.185 和風 |
ユーザー | alpha_virginis |
提出日時 | 2015-04-19 23:26:16 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 400 bytes |
コンパイル時間 | 1,657 ms |
コンパイル使用メモリ | 157,772 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 18:21:59 |
合計ジャッジ時間 | 2,156 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
#include <bits/stdc++.h> int main() { int N; int a, b; int ans; std::cin >> N; std::cin >> a >> b; ans = b - a; if( ans <= 0 ) { std::cout << -1 << std::endl; return 0; } for(int i = 1; i < N; ++i) { std::cin >> a >> b; if( b - a != ans ) { std::cout << -1 << std::endl; return 0; } } std::cout << ans << std::endl; return 0; }