結果

問題 No.178 美しいWhitespace (1)
ユーザー NagisaNagisa
提出日時 2015-09-08 06:38:35
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 8,360 KB
最終ジャッジ日時 2023-09-26 10:04:37
合計ジャッジ時間 1,913 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,852 KB
testcase_01 AC 15 ms
7,972 KB
testcase_02 AC 14 ms
7,864 KB
testcase_03 AC 15 ms
7,904 KB
testcase_04 AC 19 ms
8,240 KB
testcase_05 AC 19 ms
8,360 KB
testcase_06 AC 20 ms
8,224 KB
testcase_07 AC 18 ms
8,248 KB
testcase_08 AC 19 ms
8,220 KB
testcase_09 AC 23 ms
8,284 KB
testcase_10 AC 19 ms
8,356 KB
testcase_11 AC 19 ms
8,296 KB
testcase_12 AC 18 ms
8,360 KB
testcase_13 AC 19 ms
8,280 KB
testcase_14 AC 20 ms
8,352 KB
testcase_15 AC 19 ms
8,348 KB
testcase_16 AC 18 ms
8,224 KB
testcase_17 AC 19 ms
8,352 KB
testcase_18 AC 18 ms
8,280 KB
testcase_19 AC 19 ms
8,352 KB
testcase_20 AC 18 ms
8,248 KB
testcase_21 AC 19 ms
8,256 KB
testcase_22 AC 19 ms
8,236 KB
testcase_23 AC 19 ms
8,208 KB
testcase_24 AC 19 ms
8,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
D = [list(map(int, input().split())) for x in range(N)]
L = []
for n in range(N):
    L.append(D[n][0]+D[n][1]*4)

m = max(L)
S = 0
n = 0

while n < N:
    if (L[n-1] + L[n]) % 2 == 0:
        S += int((m - L[n])/2)
        n += 1
    else:
        S = -1
        break

print(S)
0