Skip to content

Commit

Permalink
Merge pull request #1245 from maspypy/1244
Browse files Browse the repository at this point in the history
テストケース追加 1244
  • Loading branch information
maspypy authored Sep 17, 2024
2 parents 3ed5e25 + bace24e commit d60d000
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
25 changes: 25 additions & 0 deletions number_theory/counting_primes/gen/boundaryA.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <cassert>
#include <iostream>
#include <vector>

#include "../params.h"
#include "random.h"

using namespace std;
using ll = long long;

ll f(ll n) {
ll ret = 1;
while ((ret + 1) * (ret + 1) <= n) ++ret;
return ret * ret;
}

int main(int, char* argv[]) {
long long seed = atoll(argv[1]);
auto gen = Random(seed);

ll N = gen.uniform<ll>(1000LL, N_MAX - 10L);
ll d = seed % 3 - 1;
printf("%lld\n", f(N) + d);
return 0;
}
25 changes: 25 additions & 0 deletions number_theory/counting_primes/gen/boundaryB.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <cassert>
#include <iostream>
#include <vector>

#include "../params.h"
#include "random.h"

using namespace std;
using ll = long long;

ll f(ll n) {
ll ret = 1;
while ((ret + 1) * (ret + 2) <= n) ++ret;
return ret * (ret + 1);
}

int main(int, char* argv[]) {
long long seed = atoll(argv[1]);
auto gen = Random(seed);

ll N = gen.uniform<ll>(1000LL, N_MAX - 10L);
ll d = seed % 3 - 1;
printf("%lld\n", f(N) + d);
return 0;
}
12 changes: 12 additions & 0 deletions number_theory/counting_primes/hash.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"Grothendieck_prime_00.in": "1326faec3eb42dc72ddffe46daf3940b932f48b9799f6cbf28e80504e7b34958",
"Grothendieck_prime_00.out": "e6c21e8d260fe71882debdb339d2402a2ca7648529bc2303f48649bce0380017",
"boundaryA_00.in": "b44391656257f26c801f98ac51881f8c74b0257c45c8eb71206714124ce54ec0",
"boundaryA_00.out": "bfa906b59b2adadecfb4a8f579ee5764c95d3fcc88461c95e4a33ae16e9b36e8",
"boundaryA_01.in": "6c1dda55aa851edc4d63c08655f79e9c16322d97638353359110c2db8fa6eca0",
"boundaryA_01.out": "c5d8d26963b27aa96afe57b0f45df25a4046c547cd62e8386494a76b278a3387",
"boundaryA_02.in": "a17d41183e3112b174418b9d92dce5552eb06151020751772dd9ef375d023156",
"boundaryA_02.out": "c1dab05b2d523d5b3cba478b568ed341243604ffcd172f6805498beaaae08874",
"boundaryB_00.in": "4fe3abc1bea17df8c4a5bc8e3b4b80060c25ada78fc9fd841f85e0be0cf86188",
"boundaryB_00.out": "3db2711518666d7912e03f091025454fe4ab5ec59472fde697aa4a281395fe1e",
"boundaryB_01.in": "45ac66b6c92efcf6cff04b0a4a6be711efff0b82da8933b7e7ff7569f6e0716e",
"boundaryB_01.out": "38e776345928ed1af8c6f8821d094c955bf392cbec6e03811081841028682e30",
"boundaryB_02.in": "e4613952027e08848794184d617814ad4efc765836d4239391cc552bf24e08d7",
"boundaryB_02.out": "1e19bfee04bf045df32cb6e22a17093998cb6424d64ef79dac7f676acbc87a9f",
"example_00.in": "917df3320d778ddbaa5c5c7742bc4046bf803c36ed2b050f30844ed206783469",
"example_00.out": "7de1555df0c2700329e815b93b32c571c3ea54dc967b89e81ab73b9972b72d1d",
"example_01.in": "eea8254c7500ba3de996aa8ad6af399183f04e17d4a8102fde539dbc93a90012",
Expand Down
6 changes: 6 additions & 0 deletions number_theory/counting_primes/info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/388"
[[tests]]
name = "small_prime.in"
number = 2
[[tests]]
name = "boundaryA.cpp"
number = 3
[[tests]]
name = "boundaryB.cpp"
number = 3

[params]
N_MAX = 100_000_000_000

0 comments on commit d60d000

Please sign in to comment.