Submission #797644

#TimeUsernameProblemLanguageResultExecution timeMemory
797644jackliy369A Huge Tower (CEOI10_tower)Cpython 3
80 / 100
1081 ms73220 KiB
N, D = map(int, input().split()) blocks = sorted(list(map(int, input().split()))) ans = 1 tower = [blocks[0]] for i in range(1, N): possibilities = 1 index = 0 first_possible = 0 for block in tower[index:]: if blocks[i] <= block + D: possibilities += 1 if first_possible == 0: index = i first_possible = 1 ans *= possibilities tower.append(blocks[i]) print(ans % 1000000009)
#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...