結果
| 問題 | No.185 和風 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-20 23:30:02 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 338 bytes |
| 記録 | |
| コンパイル時間 | 139 ms |
| コンパイル使用メモリ | 37,332 KB |
| 最終ジャッジ日時 | 2026-02-23 18:23:20 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include <stdio.h>
int main(void) {
// your code goes here
int n, i;
long x, y, ans;
fscanf(stdin, "%d", &n);
fscanf(stdin, "%ld %ld", &x, &y);
ans = y - x;
if (ans < 1)
ans = -1;
for(i = 0; i < n; i++){
fscanf(stdin, "%ld %ld", &x, &y);
if(ans != (y - x)){
ans = -1;
break;
}
}
printf("%ld\n", ans);
return 0;
}