結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
kongarishisyamo
|
| 提出日時 | 2016-03-05 09:08:53 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 305 bytes |
| コンパイル時間 | 501 ms |
| コンパイル使用メモリ | 58,644 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-24 14:14:42 |
| 合計ジャッジ時間 | 961 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 1 |
ソースコード
#include<iostream>
#include<cmath>
#include<string>
using namespace std;
int main(){
int N,X,Y;
int ans=-1;
int dame=1;
cin>>N;
for(int i=0;i<N;i++){
cin>>X>>Y;
if(Y-X>0){
if(ans==-1) ans=Y-X;
else if(ans!=Y-X) dame=-1;
}
}
if(dame==-1) cout<<"-1"<<endl;
else cout<<ans<<endl;
}
kongarishisyamo