Submission #809147

#TimeUsernameProblemLanguageResultExecution timeMemory
809147jackliy369A Huge Tower (CEOI10_tower)Cpython 3
0 / 100
442 ms73128 KiB
N, D = map(int, input().split()) blocks = sorted(list(map(int, input().split()))) def binary_search(l, r, size, list): ans = r + 1 while r >= l: m = (l + r) // 2 # m = l + floor(log10(r - l + 1)) # m = l + (r - l) // 1000000 if size <= list[m] + D: r = m - 1 ans = m else: l = m + 1 return ans ans = 1 i = 0 for j in range(1, N): while i < j and blocks[j] > blocks[i] + D: i += 1 # i = binary_search(i, j - 1, blocks[j], blocks) # ans *= j - i + 1 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...