結果

問題 No.185 和風
ユーザー Tsu0664Tsu0664
提出日時 2015-05-20 23:30:02
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 338 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 23,604 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 10:24:21
合計ジャッジ時間 564 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 0 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0