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

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

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

    userId_undefined

    法兰西玫瑰

    倔强青铜
    68阅读
    0回复
    2点赞
  • 队列 + 分支语句

    userId_undefined

    回来看看

    倔强青铜
    26阅读
    0回复
    0点赞
  • 题解

    userId_undefined

    米哈游miHoYo

    倔强青铜
    21阅读
    0回复
    0点赞
  • 题解

    #include<bits/stdc++.h> using namespace std; typedef long long ll; #define faster ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); const int MAXN = 1e5 + 10; // team capacity of people void solve(const int &t) { map<int, int> team; // signed every single one own team id for (int i = 0, k, a; i < t; i++) { cin >> k; for (int j = 0; j < k; j++) { cin >> a; team[a] = i; } } } int main(){ faster; }

    userId_undefined

    

    倔强青铜
    8阅读
    0回复
    0点赞
  • 题解

    这个题直接用队列模拟即可,我开始用的是queue套pair,然后pair套int和queue,到后面发现:queue没法迭代啊啊啊,警示后人。 代码:

    userId_undefined

    叫我杨同学

    秩序白银
    6阅读
    0回复
    0点赞
  • 签个到~

    #include <bits/stdc++.h> using namespace std; int n, m, x, t[1000001]; string s; queue<int> q[1001]; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> m; for (int j = 1; j <= m; j++) cin >> x, t[x] = i; } while (cin >> s && s != "STOP") if (s[0] == 'E') { cin >> x; if (q[t[x]].empty()) q[0].push(t[x]); q[t[x]].push(x); } else { x = q[0].front(); cout << q[x].front() << endl; q[x].pop(); if (q[x].empty()) q[0].pop(); } return 0; }

    userId_undefined

    LR.

    荣耀黄金
    3阅读
    0回复
    0点赞
首页