제출 #1097925

#제출 시각아이디문제언어결과실행 시간메모리
1097925sosukeA Huge Tower (CEOI10_tower)C++14
컴파일 에러
0 ms0 KiB
MOD = 10**9 + 9

n, d = map(int, input().split())
ar = list(map(int, input().split()))
ar.sort()  # sort the blocks
r = 0
sol = 1
for l in range(n):
    while r < n - 1 and ar[r + 1] - ar[l] <= d:
        r += 1
    dist = r - l + 1  # largest tower we can build when ar[l] block is the base
    sol = (sol * dist) % MOD
    
print(sol)

컴파일 시 표준 에러 (stderr) 메시지

tower.cpp:5:12: error: stray '#' in program
    5 | ar.sort()  # sort the blocks
      |            ^
tower.cpp:11:23: error: stray '#' in program
   11 |     dist = r - l + 1  # largest tower we can build when ar[l] block is the base
      |                       ^
tower.cpp:1:1: error: 'MOD' does not name a type
    1 | MOD = 10**9 + 9
      | ^~~