結果

問題 No.33 アメーバがたくさん
ユーザー convexineqconvexineq
提出日時 2020-11-25 06:59:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 405 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 71,544 KB
最終ジャッジ日時 2023-10-01 01:39:58
合計ジャッジ時間 1,831 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,132 KB
testcase_01 WA -
testcase_02 AC 71 ms
71,288 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 70 ms
71,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,d,t = map(int,input().split())
*x, = map(int,input().split())
dic = {}
for xi in x:
    pi,qi = xi//d,xi%d
    if qi in dic:
        dic[qi].append(pi)
    else:
        dic[qi] = [pi]

ans = 0
for lst in dic.values():
    st = []
    for i in lst:
        if st and st[-1][1] <= i-t:
            st[-1][1] = i+t
    else:
        st.append([i-t,i+t])
    for L,R in st:
        ans += R-L+1

print(ans)
0