| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 129115 | 冯晨硕 | 求素数 | C++ | Accepted | 100 | 1 MS | 360 KB | 389 | 2024-01-26 16:19:27 |
#include<bits/stdc++.h> #pragma GCC optimize(3) using namespace std; const int N=1e5+10; const int INF=0x3f3f3f3f; bool a[N]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); for(int i=2;i<=100000;++i) { if(a[i]==0) { cout<<i<<" "; for(int j=i+i;j<=100000;j+=i) { a[j]=1; } } } return 0; }