Submission #596661

#TimeUsernameProblemLanguageResultExecution timeMemory
596661MerakulusA Huge Tower (CEOI10_tower)C++17
30 / 100
268 ms8724 KiB
#include <iostream> #include <algorithm> #include <vector> using namespace std; #define mod 1e9 int main(){ int n = 0; int d = 0; int ans = 1; cin >> n >> d; vector<int> size(n); for(int i = 0; i < n; i++){ cin >> size[i]; } sort(size.begin(), size.end()); int r = 0; for(int i = 0; i < n; i++){ while(r < n && size[r] - size[i] <= d){ r += 1; } int tSize = r - i; ans *= tSize; } cout << ans << 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...