Submission #852894

#TimeUsernameProblemLanguageResultExecution timeMemory
852894iamjiamingliuA Huge Tower (CEOI10_tower)Cpython 3
30 / 100
358 ms262144 KiB
import sys import bisect _, diff = map(int, input().split()) nums = list(map(int, sys.stdin.readline().strip().split())) nums.sort() ways = [0] * (len(nums) + 1) ways[0] = 1 for i, n in enumerate(nums): positions = i - bisect.bisect_left(nums, n - diff) + 1 ways[i + 1] = ways[i] * positions print(ways[-1])
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...