Skip to content

Commit

Permalink
Merge pull request yosupo06#1127 from maspypy/issue_1098
Browse files Browse the repository at this point in the history
テストケース追加 1098
  • Loading branch information
maspypy authored Apr 19, 2024
2 parents aef07e8 + f2d6b1a commit 0480e86
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
3 changes: 3 additions & 0 deletions math/min_plus_convolution_convex_arbitrary/gen/hack_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
17 8
1 1 2 4 7 11 16 22 29 37 46 56 67 79 92 106 121
100000 100000 100000 100000 100000 100000 100000 2
25 changes: 25 additions & 0 deletions math/min_plus_convolution_convex_arbitrary/gen/large_small.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <cstdio>
#include "../params.h"
#include "random.h"
#include <vector>

#include "common.hpp"

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

int ns[] = {N_MAX, N_MAX, 1, 2};
int ms[] = {1, 2, N_MAX, N_MAX};

int n = ns[seed % 4];
int m = ms[seed % 4];

int LIM_1 = A_MAX / n;

vector<ll> A = rand_gen(gen, n, -LIM_1, +LIM_1);
vector<ll> B = rand_B(gen, m);
out(A, B);

return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <cstdio>
#include "../params.h"
#include "random.h"
#include <vector>

#include "common.hpp"

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

int n = N_MAX;
int m = N_MAX;

int LIM_1 = A_MAX / n * 3;

vector<ll> A = rand_gen(gen, n, -LIM_1, +LIM_1);
vector<ll> B(m);
for (int i = 0; i < m; ++i) {
B[i] = gen.uniform<int>(A_MAX * 9 / 10, A_MAX);
}

int idx = (seed % 2 == 0 ? 0 : m - 1);
B[idx] = A_MIN;

out(A, B);

return 0;
}
14 changes: 14 additions & 0 deletions math/min_plus_convolution_convex_arbitrary/hash.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"example_00.in": "94e7a5572c98d071156b0a3336dde7e00b28b5635540a1e6343e75a36378af6a",
"example_00.out": "eaf42663f5c42e63168b2a791512bc665fb26bbcfbcca275f68f579af9e0ea14",
"hack_00.in": "20e5bf7efc679e1374dc1567187cd9072dcc603362c9bf97eb5762bfb649cc95",
"hack_00.out": "aa4a5d3d83ede5d54b50be552361ccd9f515e708eae3c3f77ac41d772a6e4f0d",
"large_small_00.in": "4514dcde93bf6ff539d90e6a7db8334ea30f2825284e720dc26927cfbd8b66d2",
"large_small_00.out": "3d5f0874936440d7dd746b8f127092ae4718db832389afc716ef7b9ab5378ec3",
"large_small_01.in": "d5e95df68cb24e3e51d4cd8dfa918ac3c09f1871d685f343200ab4270578ab8b",
"large_small_01.out": "3c2cd02c3178ba83d5578bca135ff3fe8f81f735866efd10fc963761fbbca936",
"large_small_02.in": "babe673530460fa3b38fd686ea774ce384bf622ca45d26a15ae6bbdfb7665b91",
"large_small_02.out": "882cd2b4a205bed5275c2d740d0ed64f3bc57b687c75f59102a277ca8fda8533",
"large_small_03.in": "c31b2a9b26d2e48fab6b638f8d86acddb2ce4d1afd572ad8589f8c03ad06ffb8",
"large_small_03.out": "a499a578ea8a9d37ceebe0742de84191038c18fc448d7dadff7c1402e32d2de0",
"max_random_00.in": "31fc7171513ebf29954d07a04dc22bee8f70482933631efdb93178f1ddb54812",
"max_random_00.out": "6a44bf76577f441b8bd2b251b4914cb1ec0eb41fda45570b4bcf03326cde7ed8",
"max_random_01.in": "1081bf51ddbb7579470f2a0d9c37e2c04918020ba2e94f946207027e25529f35",
Expand Down Expand Up @@ -39,6 +49,10 @@
"near_power_of_2_07.out": "950d3a42aaa916482ae792c703bbb9a9967d078c8f4809039cc259ab8341d9ca",
"near_power_of_2_08.in": "a318166c253188f46be4eff479e78b57fe99cd8d28bdab274667fc47c7088e6e",
"near_power_of_2_08.out": "723c47c47ae3ceeb719c57c2c522fba02024f43ebf08605f4552e98e41513fff",
"only_first_small_00.in": "bf0dea676a336cccb21deaeea2e55bb557332064ff91b86c68bcb806beee5d34",
"only_first_small_00.out": "e5ab29e10eee0000fad9a4384fdd9e8e7b0bf77a00e770d9350e6f47bb70db2c",
"only_first_small_01.in": "f16772f3fd1a0968c82c3bfc711eab3835326d1312a95fd8df31a6bd972d0727",
"only_first_small_01.out": "4fc23c8150e177abe7589aa98b304739b7b6168d8262167e2aed5737b30b4894",
"random_00.in": "85afa03275726e4cfd8dc0d9a3ea5f63454a9506e0dac7dfa116561a923d86c5",
"random_00.out": "bd19c845ae998396927319535874307022ce7486d8f7c1cb1048f940d8078399",
"random_01.in": "a4a9a08c6e3a497215a3b75e253f7d080909ab51679332aaccd1c0139c59067b",
Expand Down
12 changes: 12 additions & 0 deletions math/min_plus_convolution_convex_arbitrary/info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/727"
name = "near_power_of_2.cpp"
number = 9

[[tests]]
name = "hack.in"
number = 1

[[tests]]
name = "large_small.cpp"
number = 4

[[tests]]
name = "only_first_small.cpp"
number = 2

[[solutions]]
name = "naive.cpp"
wrong = false
Expand Down

0 comments on commit 0480e86

Please sign in to comment.