제출 #725305

#제출 시각아이디문제언어결과실행 시간메모리
725305groshiA Huge Tower (CEOI10_tower)C++17
30 / 100
127 ms13912 KiB
#include<bits/stdc++.h> #define int long long using namespace std; int mod=1e9+7; int32_t main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int n,m,x; cin>>n>>m; vector<int> Q; for(int i=1;i<=n;i++) { cin>>x; Q.push_back(x); } sort(Q.begin(),Q.end()); int wynik=1; int r=Q.size()-1; for(int i=Q.size()-1;i>=0;i--) { while(r>=1 && Q[i]-Q[r-1]<=m) r--; wynik*=(i-r+1); wynik%=mod; } cout<<wynik; 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...