Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
41037 | liusiyu | 找素数(蓝桥杯2012决赛第1题) | C++ | Time Limit Exceeded | 1000 MS | 1008 KB | 363 | 2024-02-18 20:15:16 |
#include<bits/stdc++.h> using namespace std; int main() { long a[100005]={}; int cnt=0; bool m; for(int i=2;i<=99999999999999999;i++){ m=true; for(int j=2;j<i;j++){ if(i%j==0){ m=false; break; } } if(m==true){ a[cnt]=i; cnt++; } if(cnt==100003){ cout<<a[100002]; break; } } return 0; }