acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 首AC

    userId_undefined

    ACOI

    倔强青铜
    38阅读
    0回复
    0点赞
  • 题解(已过)

    #include<bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int a[N]; int main(){ int n,k,cnt = 0,ans = 0; cin >> n >> k; for(int i = 1;i <= n;i++) cin >> a[i]; for(int i = 1;i <= n;i++){ cnt = 0; for(int j = 1;j <= n;j++){ if(a[j] > a[i]) cnt++; } if(cnt <= k) ans++; } cout << ans; return 0; }

    userId_undefined

    山河拱手,为君一笑

    倔强青铜
    15阅读
    0回复
    1点赞
首页