結果

問題 No.33 アメーバがたくさん
ユーザー yaoshimaxyaoshimax
提出日時 2015-02-15 15:36:35
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 575 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 7,116 KB
実行使用メモリ 6,472 KB
最終ジャッジ日時 2023-10-24 17:43:56
合計ジャッジ時間 769 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N,D,T=map(int,raw_input().split())
X=map(int,raw_input().split())
lists=[[] for i in range(D)]
for x in X:
    lists[x%D].append(x)
ans=N
for i in range(D):
    lists[i].sort()
    if len(lists[i])>0:
        ans+=T*2
        for j in range(len(lists[i])-1):
            if lists[i][j+1]-lists[i][j] >= (2*T+1)*D:
                #print lists[i][j],'-',lists[i][j+1],"=",T*2
                ans += T*2
            else:
                #print lists[i][j],'-',lists[i][j+1],"=", (lists[i][j+1]-lists[i][j])/D-1
                ans += (lists[i][j+1]-lists[i][j])/D-1
print ans
0