結果

問題 No.178 美しいWhitespace (1)
ユーザー GrayCoderGrayCoder
提出日時 2018-06-03 04:48:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 366 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 10,496 KB
実行使用メモリ 8,380 KB
最終ジャッジ日時 2023-09-12 21:44:05
合計ジャッジ時間 2,117 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
7,896 KB
testcase_02 AC 16 ms
7,888 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 17 ms
8,180 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 17 ms
8,252 KB
testcase_12 AC 17 ms
8,352 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 17 ms
8,340 KB
testcase_19 WA -
testcase_20 AC 17 ms
8,188 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 17 ms
8,224 KB
testcase_24 AC 17 ms
8,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

def main():
    N = int(input())
    L = stdin.read().splitlines()

    num = [sum(a * 4 if i % 2 else a for i, a in enumerate(map(int, j.split()))) for j in L]
    even = all(map(lambda x: x % 2, num))
    odd = not any(map(lambda x: x % 2, num))
    if even or odd:
        print(max(num) * N - sum(num))
    else:
        print(-1)

main()
0