結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
mag
|
| 提出日時 | 2020-06-13 09:31:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 414 bytes |
| コンパイル時間 | 1,618 ms |
| コンパイル使用メモリ | 165,408 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-24 20:52:16 |
| 合計ジャッジ時間 | 2,052 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep2(i, a, n) for(int i = (a); i < (n); i++)
#define rep(i, n) rep2(i,0,n)
int main(){
cin.tie(nullptr);ios_base::sync_with_stdio(false);
int x,y,n,ans;cin>>n;
cin>>x>>y;
if(y-x>0){
ans=y-x;
//cout<<ans<<endl;
}else{
ans=-1;
}
n--;
for(;n>0;n--){
cin>>x>>y;
if(y-x!=ans) ans=-1;
}
cout<<ans<<endl;
}
mag