Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
41041 | liusiyu | 找素数(蓝桥杯2012决赛第1题) | C++ | Time Limit Exceeded | 1000 MS | 1000 KB | 377 | 2024-02-18 21:02:34 |
#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<=9999999999;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<<a[100001]; break; } } return 0; }