提交记录 185776
| 提交时间 |
评测时间 |
| 2026-11-28 22:00:15 |
2026-11-28 22:00:25 |
#include <bits/stdc++.h>
using namespace std;
constexpr unsigned int W = 6;
constexpr unsigned int W_MASK = ((1 << W) - 1);
typedef uint64_t word;
constexpr int N = 1000000000;
word *isp;
#define get(pos) (isp[pos >> W] >> (pos & W_MASK) & 1)
#define rev(pos) (isp[pos >> W] &= (word)-1 ^ ((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 = 2;i * i < N;i++)
{
if(!get(i)) continue;
for(int j = i * i;j < N;j += i)
rev(j);
}
}
// 1e7: 29.457 ms https://duck.ac/submission/185771
// 1e8: 498.686 ms https://duck.ac/submission/185772
// 1e9: 7.204 s https://duck.ac/submission/185773
// 1e10: 15+ s TLE (不用测了吧,结果显然)
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 6.786 s | 119 MB + 248 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-12-01 21:43:43 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠