Submission #399435

#TimeUsernameProblemLanguageResultExecution timeMemory
399435winstonyinA Huge Tower (CEOI10_tower)C++11
100 / 100
309 ms13944 KiB
#include <string> #include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> #include <cmath> #include <array> #include <map> #include <set> #include <fstream> #include <unordered_map> using namespace std; using pi = pair<int, int>; using pd = pair<double, double>; #define all(x) (x).begin(), (x).end() #define ll long long int main() { int nums, diff; cin >> nums >> diff; vector<ll> blocks; for(int i = 0; i < nums; i++) { ll temp; cin >> temp; blocks.push_back(temp); } sort(all(blocks), greater<ll>()); ll possibilities = 1; int j = 0; for(int i = 0; i < nums; i++) { while(j < nums && blocks[i]- blocks[j] <= diff) { j++; } // cout << i << " " << j << endl; possibilities = (possibilities*(j - i))%(1000000000 + 9); } cout << possibilities; 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...