結果

問題 No.178 美しいWhitespace (1)
ユーザー matsu7874matsu7874
提出日時 2015-10-07 12:58:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 303 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 8,300 KB
最終ジャッジ日時 2023-09-27 07:42:54
合計ジャッジ時間 2,108 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 17 ms
7,952 KB
testcase_02 AC 16 ms
8,192 KB
testcase_03 AC 16 ms
7,800 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 19 ms
7,860 KB
testcase_07 AC 19 ms
8,160 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 18 ms
8,116 KB
testcase_12 AC 19 ms
8,124 KB
testcase_13 AC 19 ms
7,948 KB
testcase_14 AC 19 ms
7,800 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 18 ms
8,208 KB
testcase_19 AC 19 ms
7,856 KB
testcase_20 AC 18 ms
8,300 KB
testcase_21 WA -
testcase_22 AC 19 ms
7,792 KB
testcase_23 AC 19 ms
7,856 KB
testcase_24 AC 19 ms
8,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = []
for i in range(N):
    a, b = map(int, input().split())
    L.append(a + 4 * b)
max_l = 0
for i in range(N):
    if L[i] > max_l:
        max_l = L[i]
    if L[i] % 2 == 1:
        print(-1)
        exit()
total = 0
for i in range(N):
    total += max_l - L[i]
print(total // 2)
0