提交记录 185916
| 提交时间 |
评测时间 |
| 2026-12-06 17:02:07 |
2026-12-06 17:02:14 |
#include <bits/stdc++.h>
using namespace std;
constexpr unsigned int W = 5;
constexpr unsigned int W_MASK = ((1 << W) - 1);
typedef uint32_t word;
constexpr int N = 1000000000;// 根据实际数据范围更改
word *isp;
#define get(pos) (isp[pos >> W] >> (pos & W_MASK) & (word)1)
#define clr(pos) (isp[pos >> W] &= ~((word)1 << (pos & W_MASK)))
void sieve(uint64_t n, char *s)
{
memset(s,0xFF,N / 8);
s[0] ^= 3;
isp = (word *)s;
for(int i = 4;i < N;i += 2) clr(i);
for(int i = 3;i * i < N;i++)
{
if(!get(i)) continue;
for(int j = i * i;j < N;j += i * 2)
clr(j);
}
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 4.126 s | 119 MB + 248 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-12-06 17:41:11 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠