結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
fiord
|
| 提出日時 | 2015-04-23 22:39:54 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 279 bytes |
| コンパイル時間 | 378 ms |
| コンパイル使用メモリ | 54,744 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-05 00:38:58 |
| 合計ジャッジ時間 | 861 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 1 |
ソースコード
#include <iostream>
using namespace std;
int main(){
int n; cin>>n;
int x,y,dif;
cin>>x>>y;
dif=y-x;
bool flag=true;
for(int i=1;i<n;i++){
cin>>x>>y;
if(y-x!=flag) flag=false;
}
if(dif<=0) flag=false;
if(flag) cout<<dif<<endl;
else cout<<-1<<endl;
return 0;
}
fiord