Submission #964495

#TimeUsernameProblemLanguageResultExecution timeMemory
96449512345678A Huge Tower (CEOI10_tower)C++17
100 / 100
93 ms8888 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const int mod=1e9+9; ll n, d, ans=1, x; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n>>d; vector<int> v(n); for (auto &x:v) cin>>x; sort(v.begin(), v.end()); for (int i=0; i<n; i++) { while (v[x]+d<v[i]) x++; ans=(ans*(i-x+1))%mod; } cout<<ans; }
#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...