Submission #1103109

#TimeUsernameProblemLanguageResultExecution timeMemory
1103109zephyrionA Huge Tower (CEOI10_tower)C++17
100 / 100
93 ms6992 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int mxN=1e7,MOD=1e9+9; int N,D,a[mxN],c[mxN],res=1; signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N>>D; for (int i=0; i<N; i++) cin>>a[i]; sort(a,a+N); for (int l=0,r=0; l<N; l++) for (; r<N && a[r]-a[l]<=D; r++) res=res*(r-l+1)%MOD; cout<<res; 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...