結果

問題 No.178 美しいWhitespace (1)
ユーザー ohanaohana
提出日時 2023-10-23 13:27:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 81,804 KB
実行使用メモリ 63,196 KB
最終ジャッジ日時 2023-10-23 13:27:11
合計ジャッジ時間 3,097 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,548 KB
testcase_01 AC 39 ms
53,548 KB
testcase_02 AC 36 ms
53,548 KB
testcase_03 AC 37 ms
53,548 KB
testcase_04 AC 56 ms
63,196 KB
testcase_05 AC 52 ms
63,196 KB
testcase_06 AC 52 ms
63,196 KB
testcase_07 AC 55 ms
63,196 KB
testcase_08 AC 77 ms
63,196 KB
testcase_09 AC 52 ms
63,196 KB
testcase_10 AC 58 ms
63,196 KB
testcase_11 AC 54 ms
63,196 KB
testcase_12 AC 52 ms
63,196 KB
testcase_13 AC 53 ms
63,196 KB
testcase_14 AC 53 ms
63,196 KB
testcase_15 AC 52 ms
63,196 KB
testcase_16 AC 52 ms
63,196 KB
testcase_17 AC 53 ms
63,196 KB
testcase_18 AC 54 ms
63,196 KB
testcase_19 AC 52 ms
63,196 KB
testcase_20 AC 52 ms
63,196 KB
testcase_21 AC 54 ms
63,196 KB
testcase_22 AC 54 ms
63,196 KB
testcase_23 AC 52 ms
63,196 KB
testcase_24 AC 55 ms
63,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = []

for i in range(n):
    a, b = map(int, input().split())
    A.append(a + 4 * b)

c = max(A)
ans = 0
for a in A:
    if (c - a) % 2 != 0:
        ans = -1
        break
    ans += (c - a) // 2

print(ans)
0