結果

問題 No.185 和風
ユーザー r2en_r2en_
提出日時 2017-03-17 14:30:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 503 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 64,728 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-17 19:21:44
合計ジャッジ時間 1,033 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

/* 13:30~14:00 */
#include <iostream>
using namespace std;

int main(){
    int N;
    int cnt = 0;
    long long x[1000];
    long long y[1000];
    long long z[1000];
    long long crct;
    scanf("%d",&N);

    for(int i = 0; i < N; i++){
        cin >> x[i] >> y[i];
        z[i] = y[i] - x[i];
    }
    crct = z[0];
    for(int i = 0; i < N; i++){
        if(crct == z[i])cnt++;
    }
    if(N==1)cout << "-1\n";
    if(cnt==N&&cnt>0) cout << z[0] << "\n";
    else cout << "-1\n";
    return 0;
}
0