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

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

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

    #include <iostream> #include <cmath> #include <algorithm> using namespace std; int n, m, f[2800000] = {}, q[2800000]; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) { int t; cin >> t; if (t < 0) t += 1200000; f[t] = 1; q[t] = i; } for (int i = 1; i <= m; i++) { int t; cin >> t; if (t < 0) t += 1200000; if (f[t]) cout << q[t] << endl; else cout << -1 << endl; } return 0; }

    userId_undefined

    lin kun ye!!!!!!

    倔强青铜
    71阅读
    1回复
    2点赞
首页