結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
fumi6328
|
| 提出日時 | 2018-08-23 16:50:53 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 414 bytes |
| コンパイル時間 | 609 ms |
| コンパイル使用メモリ | 55,536 KB |
| 実行使用メモリ | 6,816 KB |
| 最終ジャッジ日時 | 2024-12-26 17:16:36 |
| 合計ジャッジ時間 | 1,099 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 1 |
ソースコード
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int x[1000],y[1000];
int ans,flag = 0;
for(int i = 0; i < n; i++){
cin >> x[i] >> y[i];
if(i > 0 && (y[i]-x[i] != y[i-1]-x[i-1]))
flag = 1;
}
if(flag == 0 && y[0]-x[0] >= 0)
cout << y[0]-x[0] << endl;
else
cout << -1 << endl;
return 0;
}
fumi6328