Submission #933633

#TimeUsernameProblemLanguageResultExecution timeMemory
933633tgp07A Huge Tower (CEOI10_tower)C++17
100 / 100
225 ms10484 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<n && block[i]+d>=block[j]){ j++; } ans=(ans*(j-i)%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...