Submission #798301

# Submission time Handle Problem Language Result Execution time Memory
798301 2023-07-30T15:04:27 Z jackliy369 A Huge Tower (CEOI10_tower) Python 3
90 / 100
1000 ms 75720 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 2720 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 11 ms 2836 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 2828 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 2828 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 10 ms 2772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2768 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2804 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 11 ms 2888 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 3028 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 3968 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 481 ms 8260 KB Output is correct
2 Correct 552 ms 8332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1078 ms 30456 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1076 ms 75720 KB Time limit exceeded
2 Halted 0 ms 0 KB -