Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
41042 liusiyu 找素数(蓝桥杯2012决赛第1题) C++ 运行超时 1000 MS 224 KB 372 2024-02-18 21:06:32

Tests(0/1):


#include<bits/stdc++.h> using namespace std; int main() { //long long a[100005]={0}; //a[0]=2; int cnt=1; bool m; for(int i=3;i<=9999999;i+=2){ m=true; for(int j=3;j<=i/2;j+=2){ if(i%j==0){ m=false; break; } } if(m==true){ // a[cnt]=i; cnt++; } if(cnt==100002){ cout<<i; break; } } return 0; }


测评信息: