Submission #797609

# Submission time Handle Problem Language Result Execution time Memory
797609 2023-07-29T17:12:28 Z jackliy369 A Huge Tower (CEOI10_tower) Python 3
80 / 100
1000 ms 78968 KB
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
    for block in tower:
        if blocks[i] <= block + D:
            possibilities += 1
    ans *= possibilities
    tower.append(blocks[i])

print(ans % 1000000009)
# 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 2772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2808 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 2836 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 2840 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 2760 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 11 ms 2836 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 2772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2840 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 14 ms 2828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 80 ms 2940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 246 ms 3048 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1072 ms 4068 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1068 ms 8792 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1065 ms 32936 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1037 ms 78968 KB Time limit exceeded
2 Halted 0 ms 0 KB -