結果

問題 No.59 鉄道の旅
ユーザー yuki2006yuki2006
提出日時 2014-11-05 23:15:15
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 762 ms
コンパイル使用メモリ 6,476 KB
実行使用メモリ 32,928 KB
最終ジャッジ日時 2023-08-26 05:19:13
合計ジャッジ時間 7,050 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, raw_input().split())

MX = 1000000
data = [0] * (MX + 1)

for _ in xrange(N):
    W = int(raw_input())

    if W > 0:
        if data[W:] < K:
            data[W] += 1
    elif W < 0:
        if data[-W] > 0:
            data[-W] -= 1

print sum(data)
0