Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
56575 | yuboyuan | 第n小的质数 | C++ | Time Limit Exceeded | 2000 MS | 240 KB | 355 | 2024-11-14 17:44:28 |
#include<iostream> using namespace std; int main() { int n; cin>>n; int i=2; for(;n>0;i++) { 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; }