結果

問題 No.178 美しいWhitespace (1)
ユーザー gorugo30
提出日時 2021-02-23 20:27:35
言語 PyPy3
(7.3.15)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 372 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 65,848 KB
最終ジャッジ日時 2024-09-22 14:52:22
合計ジャッジ時間 2,412 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other MLE * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ab = [list(map(int, input().split())) for i in range(N)]
W = [ab[i][0] + 4 * ab[i][1] for i in range(N)]
cnte = 0
cnto = 0
for i in range(N):
    if W[i] % 2:
        cnto += 1
    else:
        cnte += 1
if cnto * cnte > 0:
    print(-1)
    exit()
W.sort(reverse = True)
maxx = W[0]
ans = 0
for i in range(1, N):
    ans += (W[0] - W[i]) // 2
print(ans)
0