| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 71662 | sh25_ganzy | 第n小的质数 | C++ | Accepted | 0 MS | 244 KB | 456 | 2025-10-26 18:52:17 |
#include<bits/stdc++.h> using namespace std; bool prime(long long a){ for(int k=2;k<=sqrt(a);k++){ if(a%k==0){ return false; } } return true; } int main(){ int n,cnt=0; cin>>n; long long p; for(long long i=2;i>1;i++){ if(prime(i)==true){ cnt++; } if(cnt==n){ p=i; break; } } cout<<p; return 0; }