結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,460 KB
testcase_01 AC 10 ms
6,460 KB
testcase_02 AC 9 ms
6,460 KB
testcase_03 AC 9 ms
6,460 KB
testcase_04 AC 10 ms
6,460 KB
testcase_05 AC 10 ms
6,460 KB
testcase_06 AC 10 ms
6,460 KB
testcase_07 AC 11 ms
6,460 KB
testcase_08 AC 10 ms
6,460 KB
testcase_09 AC 10 ms
6,464 KB
testcase_10 AC 10 ms
6,460 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 = [sorted(a) for a in A.values()]
ans = 0
for a in A:
    a0 = a[0]
    for ai in a[1:]:
        if a0[1] >= ai[0]: a0[1] = max(a0[1],ai[1])
        else: 
            ans += a0[1]+1-a0[0]
            a0 = ai
    ans += a0[1]+1-a0[0]
print ans
0