結果

問題 No.178 美しいWhitespace (1)
ユーザー steek79steek79
提出日時 2015-10-12 13:04:14
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 297 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 6,676 KB
実行使用メモリ 6,112 KB
最終ジャッジ日時 2023-09-28 12:39:14
合計ジャッジ時間 1,634 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,084 KB
testcase_01 AC 12 ms
5,868 KB
testcase_02 AC 11 ms
5,932 KB
testcase_03 AC 12 ms
5,872 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 11 ms
5,896 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 11 ms
5,952 KB
testcase_12 AC 11 ms
5,952 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 11 ms
5,928 KB
testcase_19 WA -
testcase_20 AC 12 ms
5,856 KB
testcase_21 WA -
testcase_22 AC 14 ms
5,936 KB
testcase_23 AC 14 ms
5,932 KB
testcase_24 AC 14 ms
5,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())

max = None
ans = 0

for i in range(N):
    spc, tab = map(int, raw_input().split())
    length = spc + 4 * tab
    if max is None:
        max = length
    elif (max - length)%2 == 1:
        ans = -1
        break
    else:
        ans += abs(max - length)/2
    
print ans
0