原题链接:CSP 201712-2 游戏
不错的题
#include <bits/stdc++.h>
using namespace std;
queue<int> l;
int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int n,k;
cin>>n>>k;
int cnt=1;
for(int i=1;i<=n;i++)
{
l.push(i);
}
while(l.size()>1)
{
int tmp=l.front();
l.pop();
if(cnt%k!=0 && cnt%10 !=k)
{
l.push(tmp);
}
cnt++;
}
cout<<l.front();
return 0;
}