結果

問題 No.185 和風
ユーザー ei1333333ei1333333
提出日時 2016-09-08 02:20:06
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 319 bytes
コンパイル時間 1,199 ms
コンパイル使用メモリ 159,364 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 17:55:34
合計ジャッジ時間 1,498 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main()
{
  int N, X[1000], Y[1000];

  cin >> N;
  for(int i = 0; i < N; i++) {
    cin >> X[i] >> Y[i];
  }

  int ret = Y[0] - X[0];
  for(int i = 0; i < N; i++) {
    if(Y[i] - X[i] != ret || ret <= 0) {
      cout << -1 << endl;
    }
  }
  cout << ret << endl;
}
0