| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 54281 | 张思存 | 第n小的质数 | C++ | Accepted | 1 MS | 248 KB | 430 | 2024-10-27 08:05:31 |
#include<bits/stdc++.h> using namespace std; int main(){ int n, s = 0; cin >> n; for(int i = 2;;i++){ bool a = 1; for(int j = 2; j <= int(sqrt(i)); j++){ if(i % j == 0){ a = 0; break; } } if(a){ s++; } if(s == n){ cout << i << endl; return 0; } } return 0; }