http://acm.hdu.edu.cn/showproblem.php?pid=2148
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int main() { int t,n,l; int i; int s[1100]; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&l); for(i=1;i<=n;i++) scanf("%d",s+i); int ans=0; for(i=1;i<=n;i++) if(s[i]>s[l]) ans++; printf("%d\n",ans); } return 0; }