Submission #930969

#TimeUsernameProblemLanguageResultExecution timeMemory
930969guagua0407A Huge Tower (CEOI10_tower)C++17
100 / 100
208 ms2896 KiB
//#pragma GCC optimize("O3") #include <vector> #include<iostream> #include<algorithm> using namespace std; const int mod=1e9+9; int main() { int n,d; cin>>n>>d; vector<int> a(n); for(int i=0;i<n;i++){ cin>>a[i]; } sort(a.begin(),a.end()); int l=0; int ans=1; for(int r=0;r<n;r++){ while(a[l]+d<a[r]){ l++; } ans=1ll*ans*(r+1-l)%mod; } cout<<ans<<'\n'; 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...