Submission #1101060

#TimeUsernameProblemLanguageResultExecution timeMemory
11010600pt1mus23A Huge Tower (CEOI10_tower)C++14
30 / 100
69 ms11340 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int #define ins insert #define pb push_back #define endl '\n' #define putr(x) cout<<x<<endl;return; #define all(x) x.begin(),x.end() #define _ << " " << mt19937 rng(time(0)); const int mod = 998244353, sze = 2e5 +23, inf = INT_MAX, LL = 20; void _0x0(){ int n,d; cin>>n>>d; vector<int> arr(n); for(int i=0;i<n;i++){cin>>arr[i];} sort(all(arr)); int ans=1; int l=0; int r = 0; while(l<n){ while(r<n && arr[r]-arr[l]<=d){ r++; } ans*=(r -l ); l++; } putr(ans); } signed main(){ ios::sync_with_stdio(0); cin.tie(0); int tt = 1; // cin>>tt; while(tt--){ _0x0(); } 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...