Submission #933632

#TimeUsernameProblemLanguageResultExecution timeMemory
933632tgp07A Huge Tower (CEOI10_tower)C++17
30 / 100
194 ms5212 KiB
#include<iostream> #include<algorithm> using namespace std; typedef long long ll; int main(){ ll n,d; cin>>n>>d; ll block[n]; for(ll i=0;i<n;i++){ cin>>block[i]; } sort(block,block+n); ll ans=1; ll j=0; for(ll i=0;i<n;i++){ while(j<n && block[i]+d>=block[j]){ j++; } ans*=(j-i); } cout<<ans<<"\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...