Submission #933631

#TimeUsernameProblemLanguageResultExecution timeMemory
933631tgp07A Huge Tower (CEOI10_tower)C++17
0 / 100
198 ms11088 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...