题目分析: 做三个指针然后预处理阶乘就行. 题目代码: #include<bits/stdc++.h> using namespace std; ; ; int n,k; struct node{ int data,num; }a[maxn]; int ans[maxn]; int fac[maxn],inv[maxn]; int fast_pow(int now,int pw){ )return now; ); z = (1ll*z*z)%mod; ) z = (1ll*z*now)%mod…