跳至正文

1 条题解

  • 0
    @ 2026-10-2 2:21:54

    用两队编号循环计算每轮配对,避免固定长度队列越界。

    #include <bits/stdc++.h>
    using namespace std;
    
    int main(){ios::sync_with_stdio(false);cin.tie(nullptr);
    
    long long a,b,k;cin>>a>>b>>k;for(long long i=0;i<k;i++)cout<<i%a+1<<" "<<i%b+1<<"\n";
    
    return 0;
    }
    
    • 1

    信息

    ID
    4007
    时间
    1000ms
    内存
    128MiB
    难度
    5
    标签
    递交数
    0
    已通过
    0
    上传者