結果

問題 No.178 美しいWhitespace (1)
ユーザー HachimoriHachimori
提出日時 2015-04-05 23:25:43
言語 Python2
(2.7.18)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 6,756 KB
実行使用メモリ 6,384 KB
最終ジャッジ日時 2023-09-17 04:38:54
合計ジャッジ時間 1,566 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
5,952 KB
testcase_01 AC 9 ms
5,952 KB
testcase_02 AC 9 ms
6,132 KB
testcase_03 AC 9 ms
6,032 KB
testcase_04 AC 12 ms
6,224 KB
testcase_05 AC 11 ms
6,140 KB
testcase_06 AC 12 ms
6,328 KB
testcase_07 AC 12 ms
6,328 KB
testcase_08 AC 11 ms
6,160 KB
testcase_09 AC 12 ms
6,140 KB
testcase_10 AC 12 ms
6,248 KB
testcase_11 AC 12 ms
6,376 KB
testcase_12 AC 11 ms
6,332 KB
testcase_13 AC 12 ms
6,276 KB
testcase_14 AC 11 ms
6,148 KB
testcase_15 AC 12 ms
6,196 KB
testcase_16 AC 12 ms
6,188 KB
testcase_17 AC 12 ms
6,140 KB
testcase_18 AC 12 ms
6,168 KB
testcase_19 AC 12 ms
6,192 KB
testcase_20 AC 12 ms
6,144 KB
testcase_21 AC 13 ms
6,136 KB
testcase_22 AC 12 ms
6,276 KB
testcase_23 AC 12 ms
6,224 KB
testcase_24 AC 12 ms
6,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
#coding:utf8


def read():
    N = input()
    ret = []
    for i in range(N):
        ret.append(map(int, raw_input().split()))
    return ret


def work(ABList):
    vList = [A + B * 4 for (A, B) in ABList]

    maxV = max(vList)

    ans = 0
    for (A, B) in ABList:
        if (maxV - (A + B * 4)) % 2 != 0:
            print -1
            return
        ans += (maxV - (A + B * 4)) / 2

    print ans


if __name__ == "__main__":
    work(read())
0