| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 137173 | 龚梓嘉 | 求素数 | C++ | Accepted | 100 | 1 MS | 368 KB | 391 | 2024-03-09 17:39:24 |
#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; }