Submission #473725

#TimeUsernameProblemLanguageResultExecution timeMemory
473725mnair797A Huge Tower (CEOI10_tower)Cpython 3
95 / 100
1083 ms64116 KiB
n,d=input().split() n=int(n) d=int(d) m=1000000009 blocks=[0]*n blocks=input().split() for i in range (n): blocks[i]=int(blocks[i]) blocks.sort() towers=[0]*n towers[0]=1 p=0 for i in range (n): while p<i and blocks[p]+d<blocks[i]: p+=1 if i>0: towers[i]=(((i-p+1)) * towers[i - 1]) % m print (towers[n - 1] % m)
#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...