Submission #391637

#TimeUsernameProblemLanguageResultExecution timeMemory
391637nicolaalexandraA Huge Tower (CEOI10_tower)C++14
100 / 100
303 ms8752 KiB
#include <bits/stdc++.h> #define DIM 2000000 #define MOD 1000000009 using namespace std; int v[DIM]; int n,d,i,j; int main (){ //ifstream cin ("date.in"); //ofstream cout ("date.out"); cin>>n>>d; for (i=1;i<=n;i++) cin>>v[i]; sort (v+1,v+n+1); long long sol = 1; for (i=j=1;i<=n;i++){ while (j <= n && v[j] + d < v[i]) j++; sol = sol * (i-j+1) % MOD; } cout<<sol; 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...