結果

問題 No.178 美しいWhitespace (1)
ユーザー first_vil
提出日時 2020-08-02 11:05:19
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 68 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-07-18 09:11:18
合計ジャッジ時間 1,493 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
ab=[tuple(map(int,input().split())) for _ in range(n)]
x=0
for i,j in ab:
    x=max(x,i+j*4)
ans=0
for i,j in ab:
    if (x-i)&1:
        print(-1)
        exit(0)
    ans+=x-i-j*4>>1
print(ans)
0