1 条题解

  • 0
    @ 2025-8-24 21:18:26

    自动搬运

    查看原文

    来自洛谷,原作者为

    avatar Temp113
    You have full control over the entire world.

    搬运于2025-08-24 21:18:25,当前版本为作者最后更新于2025-04-04 10:47:58,作者可能在搬运后再次修改,您可在原文处查看最新版

    自动搬运只会搬运当前题目点赞数最高的题解,您可前往洛谷题解查看更多

    以下是正文


    Solution

    模拟 YY 轮中,每轮报 KK 个数的情况,进行标记。

    为了方便,将编号设为 0X+Y10 \sim X + Y - 1,初始编号设为 1-1

    Code

    #include<bits/stdc++.h>
    using namespace std;
    const int X = 105;
    int x, y, k, tp = -1;
    bool flg[2 * X];
    inline int get(int aa){
    	return aa % (x + y);
    }
    int main(){
    	ios::sync_with_stdio(false);
    	cin.tie();
    	cin >> x >> y >> k;
    	for(int p = 1; p <= y; p++){
    		for(int q = 1; q <= k; q++){
    			tp++;
    			while(flg[get(tp)]) tp++;
    		}
    		flg[get(tp)] = 1;
    	}
    	for(int i = 0; i < x + y; i++) if(!flg[i]) cout << i + 1 << ' ';
    	return 0;
    }
    
    • 1

    [蓝桥杯青少年组国赛 2022] 报数游戏

    信息

    ID
    11867
    时间
    1000ms
    内存
    512MiB
    难度
    2
    标签
    递交数
    0
    已通过
    0
    上传者