Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
56576 yuboyuan 第n小的质数 C++ Time Limit Exceeded 2000 MS 236 KB 463 2024-11-14 17:47:31

Tests(0/1):


#include<iostream> using namespace std; int main() { int n; cin>>n; if(n==1) cout<<2; else { int i=3; for(;n>1;i+=2) { bool a=1; for(int j=2;j*j<=n;i++) { if(i%j==0) { a=0; break; } } if(a) n--; } cout<<i-1; } return 0; }


Judgement Protocol: