結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
hamray
|
| 提出日時 | 2017-11-17 22:30:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 602 bytes |
| コンパイル時間 | 665 ms |
| コンパイル使用メモリ | 72,620 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-25 08:53:32 |
| 合計ジャッジ時間 | 1,252 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 4 |
ソースコード
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<algorithm>
#include<vector>
#include<math.h>
#include<stack>
using namespace std;
int main(void){
int N; cin >> N;
int X, Y, cnt = 0;
for(int i = 0; i < N; i++){
cin >> Y >> X;
if(i == 0) {
cnt = Y - X;
}else{
if(cnt == Y - X){
continue;
}else{
cnt = -1;
break;
}
}
}
if(cnt < 0){
cout << -1 << endl;
}else{
cout << cnt << endl;
}
return 0;
}
hamray