結果

問題 No.178 美しいWhitespace (1)
ユーザー rocoderrocoder
提出日時 2017-06-10 04:50:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 425 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 11,872 KB
実行使用メモリ 10,340 KB
最終ジャッジ日時 2023-10-24 05:56:12
合計ジャッジ時間 2,858 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,104 KB
testcase_01 AC 28 ms
10,104 KB
testcase_02 AC 32 ms
10,104 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 34 ms
10,276 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 32 ms
10,276 KB
testcase_12 AC 30 ms
10,276 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 31 ms
10,276 KB
testcase_19 WA -
testcase_20 AC 33 ms
10,276 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# your code goes here
N=int (input())
A=[[int (i) for i in input ().split()]for i in range (N)]
nd=0
A[0][1]=A[0][1]*4
A[0][0]+=A[0][1]
M=A[0][0]
i=1
while nd==0 and i<N-1:
    A[i][1]=A[i][1]*4
    A[i][0]+=A[i][1]
    d=A[i][0]-A[i-1][0]
    if d%2!=0:
        nd=1
        print (-1)
    if M<A[i][0]:
        M=A[i][0]
    i+=1
if nd==0:
    di=0
    for i in range(N):
        di+=M-A[i][0]
        di//=2
    print (di)
0