結果

問題 No.178 美しいWhitespace (1)
ユーザー yomo3yomo3
提出日時 2020-02-20 14:19:42
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 10,524 KB
実行使用メモリ 8,324 KB
最終ジャッジ日時 2023-07-30 04:28:03
合計ジャッジ時間 1,928 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,752 KB
testcase_01 AC 16 ms
7,784 KB
testcase_02 AC 16 ms
7,764 KB
testcase_03 AC 16 ms
7,856 KB
testcase_04 AC 19 ms
8,204 KB
testcase_05 AC 18 ms
8,188 KB
testcase_06 AC 19 ms
8,212 KB
testcase_07 AC 19 ms
8,208 KB
testcase_08 AC 19 ms
8,188 KB
testcase_09 AC 19 ms
8,200 KB
testcase_10 AC 19 ms
8,208 KB
testcase_11 AC 19 ms
8,208 KB
testcase_12 AC 19 ms
8,208 KB
testcase_13 AC 18 ms
8,184 KB
testcase_14 AC 19 ms
8,280 KB
testcase_15 AC 19 ms
8,280 KB
testcase_16 AC 19 ms
8,200 KB
testcase_17 AC 19 ms
8,216 KB
testcase_18 AC 19 ms
8,212 KB
testcase_19 AC 19 ms
8,140 KB
testcase_20 AC 19 ms
8,204 KB
testcase_21 AC 18 ms
8,324 KB
testcase_22 AC 18 ms
8,180 KB
testcase_23 AC 19 ms
8,204 KB
testcase_24 AC 19 ms
8,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
AB = [list(map(int, input().split())) for i in range(N)]

w = [a + 4 * b for a, b in AB]
odd = sum(x & 1 for x in w)
if odd in (0, N):
    ma = max(w)
    ans = sum(ma - x for x in w) // 2
else:
    ans = -1
print(ans)
0