結果

問題 No.185 和風
ユーザー Tsu0664Tsu0664
提出日時 2015-05-20 23:28:58
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 338 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 23,616 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-20 10:24:21
合計ジャッジ時間 687 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 0 ms
4,380 KB
testcase_03 AC 0 ms
4,380 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,376 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 < 0)
		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