結果
| 問題 |
No.178 美しいWhitespace (1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-06-24 12:02:41 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 321 bytes |
| コンパイル時間 | 1,120 ms |
| コンパイル使用メモリ | 29,312 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-30 22:23:44 |
| 合計ジャッジ時間 | 981 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 WA * 2 |
ソースコード
#include <stdio.h>
int main(void)
{
long n, a, b, i, s[1000] = { 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;
}