Submission #852896

#TimeUsernameProblemLanguageResultExecution timeMemory
852896iamjiamingliuA Huge Tower (CEOI10_tower)Cpython 3
100 / 100
784 ms77752 KiB
import sys import bisect MOD = 10 ** 9 + 9 _, diff = map(int, input().split()) nums = list(map(int, sys.stdin.readline().strip().split())) nums.sort() ways = [0] * (len(nums) + 1) ways[0] = 1 left_i = 0 for i, n in enumerate(nums): while n > nums[left_i] + diff: left_i += 1 ways[i + 1] = (ways[i] * (i - left_i + 1)) % MOD 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...