結果

問題 No.33 アメーバがたくさん
ユーザー roiti46roiti46
提出日時 2015-02-17 00:39:33
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 40 ms
コンパイル使用メモリ 7,148 KB
実行使用メモリ 6,492 KB
最終ジャッジ日時 2023-10-24 17:44:10
合計ジャッジ時間 672 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N,D,T = map(int,raw_input().split())
A = {}
X = map(int,raw_input().split())
for x in X:
    if x%D not in A: A[x%D] = [[x/D-T, x/D+T]]
    else: A[x%D].append([x/D-T,x/D+T])

A = [a for a in A.values()]
B = []
for a in A:
    B.append([a[0]])
    for ai in a[1:]:
        if B[-1][-1][1] >= ai[0]: B[-1][-1][1] = max(B[-1][-1][1],ai[1])
        else: B[-1].append(ai)

ans = sum(sum(bi[1]+1-bi[0] for bi in b) for b in B)
print ans
0