Submission #798289

# Submission time Handle Problem Language Result Execution time Memory
798289 2023-07-30T14:53:12 Z jackliy369 A Huge Tower (CEOI10_tower) Python 3
90 / 100
1000 ms 75656 KB
N, D = map(int, input().split())
blocks = sorted(list(map(int, input().split())))

ans = 1
index = 0
for i in range(1, N):
    while index < i and blocks[i] > blocks[index] + D:
        index += 1
    ans *= i - index + 1

print(ans % 1000000009)
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2716 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 2900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2716 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2728 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2808 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 2980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 3960 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 461 ms 8316 KB Output is correct
2 Correct 540 ms 8360 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1081 ms 30484 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1087 ms 75656 KB Time limit exceeded
2 Halted 0 ms 0 KB -