結果
| 問題 | No.185 和風 |
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2015-04-19 23:28:36 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 316 bytes |
| 記録 | |
| コンパイル時間 | 213 ms |
| コンパイル使用メモリ | 39,680 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-26 01:27:21 |
| 合計ジャッジ時間 | 610 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
int main(){
int n;scanf("%d",&n);
int a,b,c;
scanf("%d%d",&a,&b);c=b-a;
for(int i=1;i<n;i++){
scanf("%d%d",&a,&b);
if(c!=b-a){
printf("-1\n");return 0;
}
}
if(c<1)printf("-1\n");
else printf("%d\n",c);
return 0;
}
184