Submission #725714

#TimeUsernameProblemLanguageResultExecution timeMemory
725714NakibA Huge Tower (CEOI10_tower)C++17
100 / 100
256 ms10488 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int mod=1e9+9; int32_t main() { int n,k;cin>>n>>k; int a[n]; for(int i=0;i<n;i++) cin>>a[i]; sort(a,a+n); int i=0,j=0,ans=1; while(i<n){ while(j<n && a[j]-a[i]<=k) j++; //cout<<j<<" "<<i<<endl; ans*=(j-i)%mod; ans%=mod; i++; } cout<<ans<<endl; return 0; }
#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...