Submission #1068330

#TimeUsernameProblemLanguageResultExecution timeMemory
1068330Kiet07A Huge Tower (CEOI10_tower)C++14
70 / 100
1 ms604 KiB
#include<bits/stdc++.h> using namespace std; long long mod=1e9+9; int a[75]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,d; cin>>n>>d; for(int i=1;i<=n;i++) { cin>>a[i]; } sort(a+1,a+n+1); long long ans=1; int l=1; for(int r=1;r<=n;r++) { while(a[r]>a[l]+d) { l++; } ans=(ans*1ll*(r-l+1))%mod; } cout<<ans; 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...