Submission #1103103

#TimeUsernameProblemLanguageResultExecution timeMemory
1103103zephyrionA Huge Tower (CEOI10_tower)C++17
30 / 100
182 ms6584 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, d; cin >> n >> d; vector<int> arr; for (int i = 0; i < n; i++) { int k; cin >> k; arr.push_back(k); } int res = 1; sort(arr.begin(), arr.end()); for (int l = 0, r = 0; l < n; l++){ for (; r < n && arr[r] - arr[l] <= d; r++){ res *= (r - l + 1); } } cout << res << endl; 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...