結果
問題 | No.185 和風 |
ユーザー |
![]() |
提出日時 | 2015-05-05 22:15:15 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 226 bytes |
コンパイル時間 | 471 ms |
コンパイル使用メモリ | 54,232 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 19:09:05 |
合計ジャッジ時間 | 871 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
#include <iostream> using namespace std; int main() { int n; cin>>n; int x, y; cin>>x>>y; int res=y-x; while (--n) { cin>>x>>y; if (y-x!=res) res=-1; } cout<<(res>0 ? res : -1)<<endl; }