Submission #1005712

#TimeUsernameProblemLanguageResultExecution timeMemory
1005712tgp07A Huge Tower (CEOI10_tower)C++17
100 / 100
166 ms11092 KiB
#include<iostream> #include<algorithm> using namespace std; typedef long long ll; const ll MOD=1e9 + 9; int main(){ ll n,d; cin>>n>>d; ll block[n]; for(ll i=0;i<n;i++){ cin>>block[i]; } sort(block,block+n); ll ans=1; ll j=0; for(ll i=0;i<n;i++){ while(j<i && block[j]+d<block[i]){ j++; } ans=((ans*(i-j+1))%MOD)%MOD; } cout<<ans<<"\n"; }
#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...