結果

問題 No.178 美しいWhitespace (1)
ユーザー Mcpu3
提出日時 2018-06-24 11:56:02
言語 C
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 320 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 29,568 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 22:23:42
合計ジャッジ時間 3,343 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other RE * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(void)
{
	long n, a, b, i, s[100] = { 0 }, m = 0, ans = 0;
	scanf("%ld", &n);
	for (i = 0; i < n; i++) {
		scanf("%ld%ld", &a, &b);
		s[i] += a + 4 * b;
		if (m < s[i]) m = s[i];
	}
	for (i = 0; i < n; i++) ans += m - s[i];
	printf(ans % 2 ? "-1" : "%ld", ans / 2);
	return 0;
}
0