結果

問題 No.178 美しいWhitespace (1)
ユーザー lam6er
提出日時 2025-03-31 17:36:50
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 486 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,612 KB
実行使用メモリ 64,156 KB
最終ジャッジ日時 2025-03-31 17:37:38
合計ジャッジ時間 2,390 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19 MLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s_list = []
mod = None
possible = True

for _ in range(n):
    a, b = map(int, input().split())
    s = a + 4 * b
    s_list.append(s)
    current_mod = s % 2
    if mod is None:
        mod = current_mod
    else:
        if current_mod != mod:
            possible = False

# Check if all mods are same
if not possible:
    print(-1)
else:
    max_s = max(s_list)
    total = 0
    for s in s_list:
        diff = max_s - s
        total += diff // 2
    print(total)
0