MLE求调
查看原帖
MLE求调
664531
de_mu_lan楼主2025/7/27 16:24
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,k,cnt=0;
	cin>>n>>k;
    bool b[114514514]={};
    
    memset(b,true,sizeof(b));
    for(int i=2;i<=n;i++){
        if(b[i]==true){
            for(int j=i;j<=n;j+=i){
                if(b[j]==true){
                    cnt++;
                    b[j]=false;
                }
                if(cnt==k){
                    cout<<j;
                    return 0;
                }
            }
        }
    }


    
	return 0;
}
2025/7/27 16:24
加载中...