結果
問題 |
No.185 和風
|
ユーザー |
![]() |
提出日時 | 2015-04-19 23:56:23 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 382 bytes |
コンパイル時間 | 1,182 ms |
コンパイル使用メモリ | 159,420 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-04 18:57:04 |
合計ジャッジ時間 | 1,836 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) int main() { int n; cin >> n; int ans = -1; rep(i, n) { int a, b; cin >> a >> b; if(ans==-1) ans = b-a; else if(ans == b-a) {} else { ans == 123456789; } } if(ans==123456789) cout << -1 << endl; else cout << ans << endl; return 0; }