結果
| 問題 | No.185 和風 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-20 23:30:02 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
AC
|
| 実行時間 | 0 ms / 1,000 ms |
| + 833µs | |
| コード長 | 338 bytes |
| 記録 | |
| コンパイル時間 | 52 ms |
| コンパイル使用メモリ | 36,352 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-23 22:04:57 |
| 合計ジャッジ時間 | 1,240 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}