Submission #672359

#TimeUsernameProblemLanguageResultExecution timeMemory
672359scrgeA Huge Tower (CEOI10_tower)C++17
30 / 100
261 ms8772 KiB
#include <bits/stdc++.h> using namespace std; int n, d; vector<int> a; int main(){ cin >> n >> d; a.resize(n); for(int i = 0; i < n; i++) cin >> a[i]; sort(a.rbegin(), a.rend()); int j = 0; int ans = 1; for(int i = 0; i < n; i++){ while(j+1 < n && a[j+1]+d >= a[i]) j++; ans *= j+1-i; } 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...