| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 139143 | 冯诚阳 | 素数检测 | C++ | Output Limit Exceeded | 847 MS | 22600 KB | 511 | 2025-12-01 18:52:23 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int n=3000000; int a[3000001]={0}; int main(){ for(int i=2;i<=n;i++){ if(a[i]!=1){ for(int j=i*i;j<=n;j+=i) a[i]=1; } } for(int i=2;i<=n;i++) if(a[i]!=1) cout<<i<<" "; return 0; }