This documentation is automatically generated by competitive-verifier/competitive-verifier
// @brief Enumerate Primes
#define PROBLEM "https://judge.yosupo.jp/problem/enumerate_primes"
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2")
#define CP_ALGO_CHECKPOINT
#include <iostream>
//#include "blazingio/blazingio.min.hpp"
#include "cp-algo/util/checkpoint.hpp"
#include "cp-algo/math/sieve.hpp"
#include <bits/stdc++.h>
using namespace std;
using namespace cp_algo::math;
void solve() {
uint32_t N, A, B;
cin >> N >> A >> B;
auto primes = sieve_wheel(N);
auto cnt = count(primes) + ranges::fold_left(wheel_primes, 0u,
[N](auto sum, auto p) {return sum + (N >= p); }
);
cp_algo::checkpoint("count");
auto X = cnt < B ? 0 : (cnt - B + A - 1) / A;
cout << cnt << ' ' << X << endl;
for(uint32_t p: wheel_primes) {
if (B == 0 && X && p <= N) {
cout << p << ' ';
X--;
}
B = (B - 1 + A) % A;
}
for(size_t i = skip(primes, 0, B); i < primes.size(); i = skip(primes, i, A)) {
cout << to_val(uint32_t(i)) << ' ';
}
cout << "\n";
cp_algo::checkpoint("print");
cp_algo::checkpoint<1>();
}
signed main() {
//freopen("input.txt", "r", stdin);
ios::sync_with_stdio(0);
cin.tie(0);
int t = 1;
//cin >> t;
while(t--) {
solve();
}
}
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj_resolve/resolver.py", line 181, in resolve
bundled_code = language.bundle(path, basedir=basedir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus.py", line 252, in bundle
bundler.update(path)
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 327, in update
assert len(lines) == len(uncommented_lines)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
| Env | Name | Status | Elapsed | Memory |
|---|---|---|---|---|
| g++ | 1_00 |
|
7 ms | 5 MB |
| g++ | 2_00 |
|
6 ms | 6 MB |
| g++ | 499477801_00 |
|
95 ms | 22 MB |
| g++ | 499999993_00 |
|
99 ms | 22 MB |
| g++ | example_00 |
|
7 ms | 6 MB |
| g++ | max_00 |
|
133 ms | 22 MB |
| g++ | max_01 |
|
146 ms | 22 MB |
| g++ | ten_00 |
|
76 ms | 11 MB |
| g++ | ten_01 |
|
37 ms | 8 MB |
| g++ | ten_02 |
|
11 ms | 8 MB |