結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2020-03-18 16:41:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 290 bytes |
| コンパイル時間 | 1,674 ms |
| コンパイル使用メモリ | 167,340 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-14 02:16:46 |
| 合計ジャッジ時間 | 2,181 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
int N;
cin >> N;
int ans = INT32_MAX;
for( int i = 0; i < N; i++ ) {
int X, Y;
cin >> X >> Y;
if( ans == INT32_MAX ) ans = Y - X;
else if( Y - X != ans ) ans = -1;
}
if( ans <= 0 ) ans = -1;
cout << ans << endl;
}
forest3