这是怎么CE的啊
查看原帖
这是怎么CE的啊
376277
假的螺丝楼主2022/5/22 17:15

RT

#include<bits/stdc++.h>
using namespace std;
queue<int>arr[1000005];
long long n,k,d=0;
int main()
{
	cin>>n>>k;
	for(int i=2;i<=n;i++)
		arr.push(i);
	while(true)
	{
		long long p=arr.front(),e;
		arr.pop();
		e=arr.front();
		while(arr.front()!=e)
		{
			if(arr.front()%p==0)
			{
				d++;
				if(d==k)
				{
					cout<<arr.front();
					return 0;
				}
				arr.pop();
			}
			else
			{
				arr.push(arr.front());
				arr.pop();
			}
		}
	}
	return 0;
}
2022/5/22 17:15
加载中...