Submission #654069

#TimeUsernameProblemLanguageResultExecution timeMemory
654069atharvdA Huge Tower (CEOI10_tower)C++14
30 / 100
250 ms2696 KiB
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<cmath> #include<fstream> #define for_n(i,a,n) for (int i=a;i<n;i++) #define pb push_back #define mp(i, j) make_pair(i, j) typedef long long ll; using namespace std; int main(){ int n, d; cin >> n >> d; int arr[n]; for(int i = 0; i < n; i++){ cin >> arr[i]; } sort(arr, arr + n); int l = 0; int w = 0; ll count = 1; for(int r=0;r < n;r++) { for(;l < r;l++) { if(arr[r]-arr[l] <= d) break; w--; } w++; count *= w; } cout << count << endl; }
#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...