Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
41039 liusiyu 找素数(蓝桥杯2012决赛第1题) C++ Time Limit Exceeded 1000 MS 276 KB 348 2024-02-18 20:27:24

Tests(0/1):


#include<iostream> using namespace std; int a[1000005]; int main() { int cnt=0; bool m; for(int i=2;i<=99999999999;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==100004){ cout<<a[100002]; break; } } return 0; }


Judgement Protocol: