結果
問題 | No.185 和風 |
ユーザー |
|
提出日時 | 2019-07-17 22:09:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 339 bytes |
コンパイル時間 | 1,456 ms |
コンパイル使用メモリ | 166,620 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 11:24:42 |
合計ジャッジ時間 | 2,002 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n, d, t, x, y; bool f = true; cin >> n; cin >> x >> y; d = y - x; if (d <= 0) f = false; for (int i = 1; i < n; i++) { cin >> x >> y; if (!f) continue; t = y - x; if (t <= 0 || d != t) f = false; } cout << (f ? d : -1) << endl; return 0; }