結果

問題 No.33 アメーバがたくさん
ユーザー ゆるくゆるく
提出日時 2014-11-25 00:31:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 625 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 11,880 KB
実行使用メモリ 10,704 KB
最終ジャッジ日時 2023-10-24 17:41:55
合計ジャッジ時間 1,072 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
10,700 KB
testcase_01 WA -
testcase_02 AC 34 ms
10,700 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 33 ms
10,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque, OrderedDict
from copy import deepcopy

N, D, T = map(int, input().split())

L = deque(list(map(int, input().split())))
V = defaultdict(list)
for l in L:
  x = (l + 10 ** 9) % D
  V[x].append((l + 10 ** 9) // D)
count = 0
for v in V:
  a = V[v]
  a.sort()
  m = -(10 ** 9)
  for i in a:
    right = i + T
    left = i - T
    if m > left:
      print(m,left)
      left = m + 1
    count += right - left + 1
    m = right
print(count)
0