Submission #659113

#TimeUsernameProblemLanguageResultExecution timeMemory
659113finn__A Huge Tower (CEOI10_tower)C++17
30 / 100
264 ms11208 KiB
#include <bits/stdc++.h> using namespace std; int main() { size_t n; int64_t d; cin >> n >> d; vector<int64_t> blocks(n); for (int64_t &x : blocks) cin >> x; sort(blocks.begin(), blocks.end()); auto it = blocks.begin(), jt = blocks.begin(); int64_t possibilities = 1; while (jt != blocks.end()) { while (it != jt && *jt - *it > d) it++; possibilities = (possibilities * (jt - it + 1)); jt++; } cout << possibilities << '\n'; }
#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...