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

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 简单|一个桶解决

    userId_undefined

    🎈🎈🎈🎈🎈🎈🎈🎈

    秩序白银
    15阅读
    0回复
    0点赞
  • 两个函数搞定

    #include<bits/stdc++.h> using namespace std; long long a[1000009]; int main(){ long long n,m; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } cin>>m; sort(a+1,a+1+n); for(int i=1;i<=m;i++){ int x; cin>>x; int pos2=upper_bound(a+1,a+1+n,x)-a; int pos1=lower_bound(a+1,a+1+n,x)-a; cout<<pos2-pos1<<endl; } return 0; }

    userId_undefined

    13nc

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