From 77fc701c3b7db71bf4173519c0d0d8c30fceaeee Mon Sep 17 00:00:00 2001 From: maspypy Date: Thu, 17 Oct 2024 05:00:16 +0900 Subject: [PATCH 1/6] new prob --- .../checker.cpp | 62 ++++ .../gen/dense.cpp | 45 +++ .../gen/example_00.in | 7 + .../gen/many_query_0.cpp | 30 ++ .../gen/many_query_1.cpp | 30 ++ .../gen/max_random.cpp | 29 ++ .../gen/near_0_and_N.cpp | 45 +++ .../gen/query_0_then_1.cpp | 30 ++ .../gen/random.cpp | 29 ++ .../gen/small.cpp | 34 ++ .../gen/small_N.cpp | 29 ++ .../hash.json | 52 +++ .../info.toml | 45 +++ .../sol/correct.cpp | 303 ++++++++++++++++++ .../task.md | 36 +++ .../verifier.cpp | 32 ++ 16 files changed, 838 insertions(+) create mode 100644 data_structure/point_set_range_composite_large_array/checker.cpp create mode 100644 data_structure/point_set_range_composite_large_array/gen/dense.cpp create mode 100644 data_structure/point_set_range_composite_large_array/gen/example_00.in create mode 100644 data_structure/point_set_range_composite_large_array/gen/many_query_0.cpp create mode 100644 data_structure/point_set_range_composite_large_array/gen/many_query_1.cpp create mode 100644 data_structure/point_set_range_composite_large_array/gen/max_random.cpp create mode 100644 data_structure/point_set_range_composite_large_array/gen/near_0_and_N.cpp create mode 100644 data_structure/point_set_range_composite_large_array/gen/query_0_then_1.cpp create mode 100644 data_structure/point_set_range_composite_large_array/gen/random.cpp create mode 100644 data_structure/point_set_range_composite_large_array/gen/small.cpp create mode 100644 data_structure/point_set_range_composite_large_array/gen/small_N.cpp create mode 100644 data_structure/point_set_range_composite_large_array/hash.json create mode 100644 data_structure/point_set_range_composite_large_array/info.toml create mode 100644 data_structure/point_set_range_composite_large_array/sol/correct.cpp create mode 100644 data_structure/point_set_range_composite_large_array/task.md create mode 100644 data_structure/point_set_range_composite_large_array/verifier.cpp diff --git a/data_structure/point_set_range_composite_large_array/checker.cpp b/data_structure/point_set_range_composite_large_array/checker.cpp new file mode 100644 index 000000000..6a66d5330 --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/checker.cpp @@ -0,0 +1,62 @@ +// https://github.com/MikeMirzayanov/testlib/blob/master/checkers/wcmp.cpp + +// The MIT License (MIT) + +// Copyright (c) 2015 Mike Mirzayanov + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#include "testlib.h" + +using namespace std; + +int main(int argc, char * argv[]) +{ + setName("compare sequences of tokens"); + registerTestlibCmd(argc, argv); + + int n = 0; + string j, p; + + while (!ans.seekEof() && !ouf.seekEof()) + { + n++; + + ans.readWordTo(j); + ouf.readWordTo(p); + + if (j != p) + quitf(_wa, "%d%s words differ - expected: '%s', found: '%s'", n, englishEnding(n).c_str(), compress(j).c_str(), compress(p).c_str()); + } + + if (ans.seekEof() && ouf.seekEof()) + { + if (n == 1) + quitf(_ok, "\"%s\"", compress(j).c_str()); + else + quitf(_ok, "%d tokens", n); + } + else + { + if (ans.seekEof()) + quitf(_wa, "Participant output contains extra tokens"); + else + quitf(_wa, "Unexpected EOF in the participants output"); + } +} diff --git a/data_structure/point_set_range_composite_large_array/gen/dense.cpp b/data_structure/point_set_range_composite_large_array/gen/dense.cpp new file mode 100644 index 000000000..9fddb634f --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/gen/dense.cpp @@ -0,0 +1,45 @@ +#include "random.h" +#include +#include "../params.h" + +using namespace std; + +int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); + + int n = N_MAX; + int q = Q_MAX; + printf("%d %d\n", n, q); + + int ws[] = {1, 1000, 1000000}; + int w = ws[seed % 3]; + + int L = gen.uniform(0, n - w); + int R = L + w; + + auto idx = [&]() -> int { return gen.uniform(L, R - 1); }; + + auto idx2 = [&]() -> pair { + int a = idx(), b = idx(); + if (a > b) swap(a, b); + ++b; + return {a, b}; + }; + + for (int i = 0; i < q; i++) { + int t = gen.uniform(0, 1); + printf("%d ", t); + if (t == 0) { + int p = idx(); + int c = gen.uniform(1LL, MOD - 1); + int d = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p, c, d); + } else { + auto [a, b] = idx2(); + int x = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", a, b, x); + } + } + return 0; +} diff --git a/data_structure/point_set_range_composite_large_array/gen/example_00.in b/data_structure/point_set_range_composite_large_array/gen/example_00.in new file mode 100644 index 000000000..97a0a3a07 --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/gen/example_00.in @@ -0,0 +1,7 @@ +1000000000 6 +0 100 2 3 +0 10000 4 5 +1 99 100 10 +1 1 1000000000 1 +0 1000000 6 7 +1 1 1000000000 1 diff --git a/data_structure/point_set_range_composite_large_array/gen/many_query_0.cpp b/data_structure/point_set_range_composite_large_array/gen/many_query_0.cpp new file mode 100644 index 000000000..a6ee9ad9f --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/gen/many_query_0.cpp @@ -0,0 +1,30 @@ +#include "random.h" +#include +#include "../params.h" + +using namespace std; + +int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); + + int n = N_MAX; + int q = Q_MAX; + printf("%d %d\n", n, q); + for (int i = 0; i < q; i++) { + int t = gen.uniform(0, 100); + t = (t == 0 ? 1 : 0); + printf("%d ", t); + if (t == 0) { + int p = gen.uniform(0, n - 1); + int c = gen.uniform(1LL, MOD - 1); + int d = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p, c, d); + } else { + auto p = gen.uniform_pair(0, n); + int x = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p.first, p.second, x); + } + } + return 0; +} diff --git a/data_structure/point_set_range_composite_large_array/gen/many_query_1.cpp b/data_structure/point_set_range_composite_large_array/gen/many_query_1.cpp new file mode 100644 index 000000000..bd2fb1306 --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/gen/many_query_1.cpp @@ -0,0 +1,30 @@ +#include "random.h" +#include +#include "../params.h" + +using namespace std; + +int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); + + int n = N_MAX; + int q = Q_MAX; + printf("%d %d\n", n, q); + for (int i = 0; i < q; i++) { + int t = gen.uniform(0, 100); + t = (t == 0 ? 0 : 1); + printf("%d ", t); + if (t == 0) { + int p = gen.uniform(0, n - 1); + int c = gen.uniform(1LL, MOD - 1); + int d = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p, c, d); + } else { + auto p = gen.uniform_pair(0, n); + int x = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p.first, p.second, x); + } + } + return 0; +} diff --git a/data_structure/point_set_range_composite_large_array/gen/max_random.cpp b/data_structure/point_set_range_composite_large_array/gen/max_random.cpp new file mode 100644 index 000000000..3e38ce4be --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/gen/max_random.cpp @@ -0,0 +1,29 @@ +#include "random.h" +#include +#include "../params.h" + +using namespace std; + +int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); + + int n = N_MAX; + int q = Q_MAX; + printf("%d %d\n", n, q); + for (int i = 0; i < q; i++) { + int t = gen.uniform(0, 1); + printf("%d ", t); + if (t == 0) { + int p = gen.uniform(0, n - 1); + int c = gen.uniform(1LL, MOD - 1); + int d = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p, c, d); + } else { + auto p = gen.uniform_pair(0, n); + int x = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p.first, p.second, x); + } + } + return 0; +} diff --git a/data_structure/point_set_range_composite_large_array/gen/near_0_and_N.cpp b/data_structure/point_set_range_composite_large_array/gen/near_0_and_N.cpp new file mode 100644 index 000000000..e338ed916 --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/gen/near_0_and_N.cpp @@ -0,0 +1,45 @@ +#include "random.h" +#include +#include "../params.h" + +using namespace std; + +int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); + + int n = N_MAX; + int q = Q_MAX; + printf("%d %d\n", n, q); + + auto idx = [&]() -> int { + int t = gen.uniform(0, 2); + if (t == 0) return gen.uniform(0, n - 1); + if (t == 1) return gen.uniform(0, 1000); + if (t == 2) return gen.uniform(n - 1000, n - 1); + return 0; + }; + + auto idx2 = [&]() -> pair { + int a = idx(), b = idx(); + if (a > b) swap(a, b); + ++b; + return {a, b}; + }; + + for (int i = 0; i < q; i++) { + int t = gen.uniform(0, 1); + printf("%d ", t); + if (t == 0) { + int p = idx(); + int c = gen.uniform(1LL, MOD - 1); + int d = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p, c, d); + } else { + auto [a, b] = idx2(); + int x = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", a, b, x); + } + } + return 0; +} diff --git a/data_structure/point_set_range_composite_large_array/gen/query_0_then_1.cpp b/data_structure/point_set_range_composite_large_array/gen/query_0_then_1.cpp new file mode 100644 index 000000000..64e0bc34d --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/gen/query_0_then_1.cpp @@ -0,0 +1,30 @@ +#include "random.h" +#include +#include "../params.h" + +using namespace std; + +int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); + + int n = N_MAX; + int q = Q_MAX; + printf("%d %d\n", n, q); + for (int i = 0; i < q; i++) { + int t = (i < q / 2 ? 0 : 1); + if (gen.uniform(0, 100) == 0) t = 1 - t; + printf("%d ", t); + if (t == 0) { + int p = gen.uniform(0, n - 1); + int c = gen.uniform(1LL, MOD - 1); + int d = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p, c, d); + } else { + auto p = gen.uniform_pair(0, n); + int x = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p.first, p.second, x); + } + } + return 0; +} diff --git a/data_structure/point_set_range_composite_large_array/gen/random.cpp b/data_structure/point_set_range_composite_large_array/gen/random.cpp new file mode 100644 index 000000000..e2601e5ae --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/gen/random.cpp @@ -0,0 +1,29 @@ +#include "random.h" +#include +#include "../params.h" + +using namespace std; + +int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); + + int n = gen.uniform(1LL, N_MAX); + int q = gen.uniform(1LL, Q_MAX); + printf("%d %d\n", n, q); + for (int i = 0; i < q; i++) { + int t = gen.uniform(0, 1); + printf("%d ", t); + if (t == 0) { + int p = gen.uniform(0, n - 1); + int c = gen.uniform(1LL, MOD - 1); + int d = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p, c, d); + } else { + auto p = gen.uniform_pair(0, n); + int x = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p.first, p.second, x); + } + } + return 0; +} diff --git a/data_structure/point_set_range_composite_large_array/gen/small.cpp b/data_structure/point_set_range_composite_large_array/gen/small.cpp new file mode 100644 index 000000000..9b8db4047 --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/gen/small.cpp @@ -0,0 +1,34 @@ +#include "random.h" +#include + +using namespace std; + +int main(int, char* argv[]) { + + long long seed = atoll(argv[1]); + auto gen = Random(seed); + + int n = seed % 10 + 1; + int q = 1000; + printf("%d %d\n", n, q); + for (int i = 0; i < n; i++) { + int a = gen.uniform(1, 998244352); + int b = gen.uniform(0, 998244352); + printf("%d %d\n", a, b); + } + for (int i = 0; i < q; i++) { + int t = gen.uniform(0, 1); + printf("%d ", t); + if (t == 0) { + int p = gen.uniform(0, n - 1); + int c = gen.uniform(1, 998244352); + int d = gen.uniform(0, 998244352); + printf("%d %d %d\n", p, c, d); + } else { + auto p = gen.uniform_pair(0, n); + int x = gen.uniform(0, 998244352); + printf("%d %d %d\n", p.first, p.second, x); + } + } + return 0; +} diff --git a/data_structure/point_set_range_composite_large_array/gen/small_N.cpp b/data_structure/point_set_range_composite_large_array/gen/small_N.cpp new file mode 100644 index 000000000..c06f2d02f --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/gen/small_N.cpp @@ -0,0 +1,29 @@ +#include "random.h" +#include +#include "../params.h" + +using namespace std; + +int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); + + int n = seed + 1; + int q = Q_MAX; + printf("%d %d\n", n, q); + for (int i = 0; i < q; i++) { + int t = gen.uniform(0, 1); + printf("%d ", t); + if (t == 0) { + int p = gen.uniform(0, n - 1); + int c = gen.uniform(1LL, MOD - 1); + int d = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p, c, d); + } else { + auto p = gen.uniform_pair(0, n); + int x = gen.uniform(0LL, MOD - 1); + printf("%d %d %d\n", p.first, p.second, x); + } + } + return 0; +} diff --git a/data_structure/point_set_range_composite_large_array/hash.json b/data_structure/point_set_range_composite_large_array/hash.json new file mode 100644 index 000000000..e3b3cf9a1 --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/hash.json @@ -0,0 +1,52 @@ +{ + "dense_00.in": "25ff5ac450c9dab241779df665c4b43c1c0830a216213d1b5f86a5d6929a2406", + "dense_00.out": "3b9f058a71b3a6dd25f3fe603c26868aedaef50ff326f46926c022011654aac7", + "dense_01.in": "6a15dace7009eeafa28cbe86bac75d974a6c8b8cae2ac10e6a6483caf6525942", + "dense_01.out": "6fa53805886de9e741d15adae85278aad219b68e0026251a97c1de82feb77293", + "dense_02.in": "c2549ebfdf28f568ab1fa9ca86a12628982c1a35e99656906d4196b4e4ec9ad5", + "dense_02.out": "a594ed50faded567179fc9972f110a720a6b830f8037611cd93541087ea8f446", + "example_00.in": "3512449209bf077afb69df94260a1135d3d71458c6a742170c4bbfc41fbfcb1e", + "example_00.out": "432f365abd0d9d7b9b67b6b0be5fa0bd2940ee4f9df0d2cbc318658f7aeea7af", + "many_query_0_00.in": "266aaa62a2037ae6556dc010f2b33a2e7bcdde112e07f3cbafddfa5abdc77776", + "many_query_0_00.out": "957d4cb6f98ccbb2a22fa82f5c724760e82788cc9aa82f337abe1782b2b115fe", + "many_query_0_01.in": "e48f4d8c173a2462e4a1f9068ea91ec536156f4e0d54ba52179bd78878ce7daa", + "many_query_0_01.out": "340f4de09ac0e70edd04a0a497b2c8dd3f26ce6f4b685fad1871ad789bf86fd3", + "many_query_1_00.in": "2b5fb31f964929d1101330fc8179b3701da6307a06e722d075fe6edf50ef9c4d", + "many_query_1_00.out": "33209df1e49a46812e9a5ce0bf30439653166ea86328114c940c22dddda88ccf", + "many_query_1_01.in": "5be003bd7b59ac03cdf4f4565b7aea7353fbe2f7cc9eb5582b9b529cced7295b", + "many_query_1_01.out": "7256e8aa0a56f3c515529042e2ccd52543ab337602428294c9ac64973a8bd16a", + "max_random_00.in": "1a46cf6763ba23954514bfec31dbc91fb1c3eb392b3783a115e9c6ff045a3cab", + "max_random_00.out": "8734ffdd631ac7601439c42efc1d51f3c4a0d753f749a8145d175415bad1ddfc", + "max_random_01.in": "9e294cfe7036a6d55c35bbb4b5be0b985e5f86c94c1b7fdc25163f4aab070af6", + "max_random_01.out": "e3d7c2c4c12cdf4d221be54693205af3cb7706db71ac385e754822065ae3baeb", + "max_random_02.in": "986e29118925b5ac8eeeac69b2815cc2db850b49f11496dbff390325061b8517", + "max_random_02.out": "3542acd63b61e6f291f3ceb78e0c1d72b8d16b6720a49e1062ae70f00dd3dd52", + "near_0_and_N_00.in": "4209c9020ee5dc1cd501562fab35d5bc4fc50ff0a3991eb1dd2d4b04ff2064a9", + "near_0_and_N_00.out": "19371ff3745ba4d4387389510f78c5083b666c14d43e838122ce1bc87655903c", + "near_0_and_N_01.in": "c26f31ea8e4bbd64e1218c3d385c4a44a388b55da5431d85dc35858389fc3cb2", + "near_0_and_N_01.out": "bff7e21a06d0c636bf85443f9b6a69d75a8a03b3a1aa6785206458021d9da38d", + "query_0_then_1_00.in": "30e106f17b1894f82e8e80f508a0fc50c7d81ff94754d320d8ed8efbd1507060", + "query_0_then_1_00.out": "75546d55713b91a363c6c4fe438330e3fa718e63aeb072547e94552f47b47627", + "query_0_then_1_01.in": "5598fa921a50c5550a272dab6af779c86d183b270d82a2804d3087ea50c392ef", + "query_0_then_1_01.out": "0e24b7a6b9ded346d2b8a78839aa327f5276ad2ce9b63784ecbd5ca3a20ec220", + "random_00.in": "3bf06d96dcd52541fee71fee92ec2f90f260dc3336f047c33c8ffd7b650061ee", + "random_00.out": "b44acfd213f368ab5076c8331bd3600ad0b4a51cfd2a1dc64120d27cf3f3ae67", + "random_01.in": "9a1d7f7bd483b61408bd166049dba2b9b3feb14db82be3d8650712697538c6d4", + "random_01.out": "613b95068e00f605fb824b2ee6146c7d41b20655f6526de39c6d58f3a9f01283", + "random_02.in": "a5916633e2255d79686ee44b2f6da490b3c42d4169943529b09d7b98c8734d10", + "random_02.out": "33181ac48e3e36c50c01bc8e6ebe70fe1171e375c056a4d2e342b4c2b32a0d34", + "random_03.in": "c08e9629f597de496635ccddcb0ff789a3e0c1b3f6d6361f2117f2c51fcef88c", + "random_03.out": "5120455fe65941c15d39da26fa29b581b625e88d48649ad54b2d0c54f4e1e63c", + "random_04.in": "70c753a91c0bec8a07f1fe75be82775310ba36369f730cf954734b4fe3f61723", + "random_04.out": "e38e6f3c743f669247e5caa8e75467ce86646efb87074b16febface9927c9caf", + "small_N_00.in": "6e9c2c2fdaf8f957fa55d210bac5512f4c93d60ee14dcc65c73b2b3c28dd8999", + "small_N_00.out": "2ccb852951af03e329b1a7582e551246ee8fb4be110d217f48a56865e7357a91", + "small_N_01.in": "e049bd10c4a749d461e43c10f72f5e7f79aaa91b5294022fafa2c03aefa39117", + "small_N_01.out": "e9487d9416002c18b55d1b15e47300d278516e703e3264e9d9218d7aede7c06c", + "small_N_02.in": "358ea7f4b08c464368d1a678fdec1768867c08f231e3d49123a92a2993b25f9d", + "small_N_02.out": "2d91f57da5c15f7024962937601c5ca4da02df3faca0a06b8bd799b4a50e93ad", + "small_N_03.in": "48fd3ca0b624c2b0e235b2f3fdcf86a6f813ac7fe673b6ddf245c339188d85ef", + "small_N_03.out": "357450158e748ae0aa157b200a557dff2003828082d147bcd7483be5e39a4a3a", + "small_N_04.in": "7ae72374ef9269f4ca38ad2e3f3736a8ed25b426be8bc3c92fade9503383875f", + "small_N_04.out": "61f740e46c27c08f57b514b421d21135f03876401a51a2c76c3cf10e4710386a" +} \ No newline at end of file diff --git a/data_structure/point_set_range_composite_large_array/info.toml b/data_structure/point_set_range_composite_large_array/info.toml new file mode 100644 index 000000000..f20866f24 --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/info.toml @@ -0,0 +1,45 @@ +title = 'Point Set Range Composite (Large Array)' +timelimit = 10.0 +forum = "https://github.com/yosupo06/library-checker-problems/issues/828" +[[tests]] + name = "example.in" + number = 1 + +[[tests]] + name = "random.cpp" + number = 5 + +[[tests]] + name = "small_N.cpp" + number = 5 + +[[tests]] + name = "max_random.cpp" + number = 3 + +[[tests]] + name = "many_query_0.cpp" + number = 2 + +[[tests]] + name = "many_query_1.cpp" + number = 2 + +[[tests]] + name = "query_0_then_1.cpp" + number = 2 + +[[tests]] + name = "near_0_and_N.cpp" + number = 2 + +[[tests]] + name = "dense.cpp" + number = 3 + + + +[params] + N_MAX = 1_000_000_000 + Q_MAX = 1_000_000 + MOD = 998244353 diff --git a/data_structure/point_set_range_composite_large_array/sol/correct.cpp b/data_structure/point_set_range_composite_large_array/sol/correct.cpp new file mode 100644 index 000000000..096b426dd --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/sol/correct.cpp @@ -0,0 +1,303 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +using ll = long long; +using u32 = uint32_t; +using u64 = uint64_t; + +using pi = pair; +using vi = vector; +template +using vc = vector; + +#define FOR1(a) for (ll _ = 0; _ < ll(a); ++_) +#define FOR2(i, a) for (ll i = 0; i < ll(a); ++i) +#define FOR3(i, a, b) for (ll i = a; i < ll(b); ++i) +#define FOR4(i, a, b, c) for (ll i = a; i < ll(b); i += (c)) +#define FOR1_R(a) for (ll i = (a)-1; i >= ll(0); --i) +#define FOR2_R(i, a) for (ll i = (a)-1; i >= ll(0); --i) +#define FOR3_R(i, a, b) for (ll i = (b)-1; i >= ll(a); --i) +#define overload4(a, b, c, d, e, ...) e +#define overload3(a, b, c, d, ...) d +#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__) +#define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__) + +#define FOR_subset(t, s) for (ll t = (s); t >= 0; t = (t == 0 ? -1 : (t - 1) & (s))) +#define all(x) x.begin(), x.end() +#define len(x) ll(x.size()) +#define elif else if + +#define eb emplace_back +#define mp make_pair +#define mt make_tuple +#define fi first +#define se second + +#define MIN(v) *min_element(all(v)) +#define MAX(v) *max_element(all(v)) +#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x))) +#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x))) +#define UNIQUE(x) sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit() + +template +T POP(vc &que) { + T a = que.back(); + que.pop_back(); + return a; +} + +template +inline bool chmax(T &a, const S &b) { + return (a < b ? a = b, 1 : 0); +} +template +inline bool chmin(T &a, const S &b) { + return (a > b ? a = b, 1 : 0); +} + +// op(F, G) = comp(G,F), F のあとで G +template +struct Monoid_Affine { + using F = pair; + using value_type = F; + using X = value_type; + static constexpr F op(const F &x, const F &y) noexcept { return F({x.first * y.first, x.second * y.first + y.second}); } + static constexpr F inverse(const F &x) { + auto [a, b] = x; + a = K(1) / a; + return {a, a * (-b)}; + } + static constexpr K eval(const F &f, K x) noexcept { return f.first * x + f.second; } + static constexpr F unit() { return {K(1), K(0)}; } + static constexpr bool commute = false; +}; + +// 常にほとんどの要素が unit であることが保証されるような動的セグ木 +// したがって、default_prod の類は持たせられず、acted monoid も一般には扱えない +// 追加 N 回のときノード数 N 以下が保証される +template +struct Dynamic_SegTree_Sparse { + using MX = Monoid; + using X = typename MX::value_type; + + struct Node { + ll idx; + Node *l, *r; + X prod, x; + }; + const int NODES; + const ll L0, R0; + Node *pool; + int pid; + using np = Node *; + vc FREE; + + Dynamic_SegTree_Sparse(int NODES, ll L0, ll R0) : NODES(NODES), L0(L0), R0(R0), pid(0) { pool = new Node[NODES]; } + ~Dynamic_SegTree_Sparse() { delete[] pool; } + + void free_subtree(np c) { + auto dfs = [&](auto &dfs, np c) -> void { + if (c->l) dfs(dfs, c->l); + if (c->r) dfs(dfs, c->r); + FREE.eb(c); + }; + dfs(dfs, c); + } + + np new_root() { return nullptr; } + + np new_node(ll idx, const X x) { + if (!FREE.empty()) { + np c = POP(FREE); + c->idx = idx, c->l = c->r = nullptr; + c->prod = c->x = x; + return c; + } + assert(pid < NODES); + pool[pid].idx = idx; + pool[pid].l = pool[pid].r = nullptr; + pool[pid].x = pool[pid].prod = x; + return &(pool[pid++]); + } + + X prod(np root, ll l, ll r) { + assert(L0 <= l && l <= r && r <= R0); + if (l == r) return MX::unit(); + X x = MX::unit(); + prod_rec(root, L0, R0, l, r, x); + return x; + } + + np set(np root, ll i, const X &x) { + assert(L0 <= i && i < R0); + return set_rec(root, L0, R0, i, x); + } + + X get(np root, ll idx) { + auto dfs = [&](auto &dfs, np c) -> X { + if (!c) return Monoid::unit(); + if (idx == c->idx) return c->x; + if (idx < (c->idx)) return dfs(dfs, c->l); + return dfs(dfs, c->r); + }; + return dfs(dfs, root); + } + +private: + void update(np c) { + c->prod = c->x; + if (c->l) c->prod = MX::op(c->l->prod, c->prod); + if (c->r) c->prod = MX::op(c->prod, c->r->prod); + } + + np copy_node(np c) { + if (!c || !PERSISTENT) return c; + assert(pid < NODES); + pool[pid].idx = c->idx; + pool[pid].l = c->l; + pool[pid].r = c->r; + pool[pid].x = c->x; + pool[pid].prod = c->prod; + return &(pool[pid++]); + } + + np set_rec(np c, ll l, ll r, ll i, X x) { + if (!c) { + c = new_node(i, x); + return c; + } + c = copy_node(c); + if (c->idx == i) { + c->x = x; + update(c); + return c; + } + ll m = (l + r) / 2; + if (i < m) { + if (c->idx < i) swap(c->idx, i), swap(c->x, x); + c->l = set_rec(c->l, l, m, i, x); + } + if (m <= i) { + if (i < c->idx) swap(c->idx, i), swap(c->x, x); + c->r = set_rec(c->r, m, r, i, x); + } + update(c); + return c; + } + + void prod_rec(np c, ll l, ll r, ll ql, ll qr, X &x) { + chmax(ql, l); + chmin(qr, r); + if (ql >= qr || !c) return; + if (l == ql && r == qr) { + x = MX::op(x, c->prod); + return; + } + ll m = (l + r) / 2; + prod_rec(c->l, l, m, ql, qr, x); + if (ql <= (c->idx) && (c->idx) < qr) x = MX::op(x, c->x); + prod_rec(c->r, m, r, ql, qr, x); + } +}; + +template +struct modint { + static constexpr u32 umod = u32(mod); + static_assert(umod < u32(1) << 31); + u32 val; + + static modint raw(u32 v) { + modint x; + x.val = v; + return x; + } + constexpr modint() : val(0) {} + constexpr modint(u32 x) : val(x % umod) {} + constexpr modint(u64 x) : val(x % umod) {} + constexpr modint(int x) : val((x %= mod) < 0 ? x + mod : x){}; + constexpr modint(ll x) : val((x %= mod) < 0 ? x + mod : x){}; + bool operator<(const modint &other) const { return val < other.val; } + modint &operator+=(const modint &p) { + if ((val += p.val) >= umod) val -= umod; + return *this; + } + modint &operator-=(const modint &p) { + if ((val += umod - p.val) >= umod) val -= umod; + return *this; + } + modint &operator*=(const modint &p) { + val = u64(val) * p.val % umod; + return *this; + } + modint &operator/=(const modint &p) { + *this *= p.inverse(); + return *this; + } + modint operator-() const { return modint::raw(val ? mod - val : u32(0)); } + modint operator+(const modint &p) const { return modint(*this) += p; } + modint operator-(const modint &p) const { return modint(*this) -= p; } + modint operator*(const modint &p) const { return modint(*this) *= p; } + modint operator/(const modint &p) const { return modint(*this) /= p; } + bool operator==(const modint &p) const { return val == p.val; } + bool operator!=(const modint &p) const { return val != p.val; } + modint inverse() const { + int a = val, b = mod, u = 1, v = 0, t; + while (b > 0) { + t = a / b; + swap(a -= t * b, b), swap(u -= t * v, v); + } + return modint(u); + } + modint pow(ll n) const { + assert(n >= 0); + modint ret(1), mul(val); + while (n > 0) { + if (n & 1) ret *= mul; + mul *= mul; + n >>= 1; + } + return ret; + } + static constexpr int get_mod() { return mod; } +}; + +using modint998 = modint<998244353>; + +using mint = modint998; +using Mono = Monoid_Affine; + +int get() { + int x; + scanf("%d", &x); + return x; +} + +void solve() { + ll N = get(), Q = get(); + Dynamic_SegTree_Sparse seg(Q, 0, N); + using np = decltype(seg)::np; + np root = seg.new_root(); + + FOR(Q) { + ll t = get(); + if (t == 0) { + ll i = get(), a = get(), b = get(); + root = seg.set(root, i, {mint(a), mint(b)}); + } + if (t == 1) { + ll L = get(), R = get(), x = get(); + mint ANS = Mono::eval(seg.prod(root, L, R), mint(x)); + printf("%d\n", ANS.val); + } + } +} + +signed main() { solve(); } diff --git a/data_structure/point_set_range_composite_large_array/task.md b/data_structure/point_set_range_composite_large_array/task.md new file mode 100644 index 000000000..7fd0b3cb2 --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/task.md @@ -0,0 +1,36 @@ +## @{keyword.statement} + +@{lang.en} +Given a size $N$ sequence of linear functions $f_0, f_1, ..., f_{N-1}$. Initially, $f_i(x)=x$ For all $i$. Process $Q$ queries as follows: + +- `0 $p$ $c$ $d$`: change $f_p \gets cx + d$. +- `1 $l$ $r$ $x$`: print $f_{r-1}(f_{r-2}(...f_l(x))) \bmod @{param.MOD}$. + +@{lang.ja} +長さ $N$ の(一次)関数列 $f_0, f_1, ..., f_{N-1}$ が与えられる。 +はじめすべての $i$ について $f_i(x)=x$ である。$Q$ 個のクエリが飛んできます。処理してください。 + +- `0 $p$ $c$ $d$`: $f_p \gets cx + d$ に変更 +- `1 $l$ $r$ $x$`: $f_{r-1}(f_{r-2}(...f_l(x))) \bmod @{param.MOD}$ を出力する。 +@{lang.end} + +## @{keyword.constraints} + +- $1 \leq N \leq @{param.N_MAX}$ +- $1 \leq Q \leq @{param.Q_MAX}$ +- $1 \leq a_i, c < @{param.MOD}$ +- $0 \leq b_i, d, x < @{param.MOD}$ +- $0 \leq p < N$ +- $0 \leq l < r \leq N$ + +## @{keyword.input} + +~~~ +$N$ $Q$ +$\textrm{Query}_0$ +$\textrm{Query}_1$ +: +$\textrm{Query}_{Q - 1}$ +~~~ + +@{example.example_00} diff --git a/data_structure/point_set_range_composite_large_array/verifier.cpp b/data_structure/point_set_range_composite_large_array/verifier.cpp new file mode 100644 index 000000000..fe34443d3 --- /dev/null +++ b/data_structure/point_set_range_composite_large_array/verifier.cpp @@ -0,0 +1,32 @@ +#include "testlib.h" +#include "params.h" + +int main() { + registerValidation(); + + int n = inf.readInt(1, N_MAX, "N"); + inf.readSpace(); + int q = inf.readInt(1, Q_MAX, "Q"); + inf.readChar('\n'); + + for (int i = 0; i < q; i++) { + int t = inf.readInt(0, 1, "t"); + inf.readSpace(); + if (t == 0) { + inf.readInt(0, n - 1, "p"); + inf.readSpace(); + inf.readInt(1, MOD - 1, "c"); + inf.readSpace(); + inf.readInt(0, MOD - 1, "d"); + } else { + int l = inf.readInt(0, n - 1, "l"); + inf.readSpace(); + inf.readInt(l + 1, n, "r"); + inf.readSpace(); + inf.readInt(0, MOD - 1, "x"); + } + inf.readChar('\n'); + } + inf.readEof(); + return 0; +} From 2d1cc181b1e5591735e0f4e9e0cd85a8f4f02576 Mon Sep 17 00:00:00 2001 From: maspypy Date: Thu, 17 Oct 2024 05:03:20 +0900 Subject: [PATCH 2/6] rm unused --- .../gen/small.cpp | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 data_structure/point_set_range_composite_large_array/gen/small.cpp diff --git a/data_structure/point_set_range_composite_large_array/gen/small.cpp b/data_structure/point_set_range_composite_large_array/gen/small.cpp deleted file mode 100644 index 9b8db4047..000000000 --- a/data_structure/point_set_range_composite_large_array/gen/small.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "random.h" -#include - -using namespace std; - -int main(int, char* argv[]) { - - long long seed = atoll(argv[1]); - auto gen = Random(seed); - - int n = seed % 10 + 1; - int q = 1000; - printf("%d %d\n", n, q); - for (int i = 0; i < n; i++) { - int a = gen.uniform(1, 998244352); - int b = gen.uniform(0, 998244352); - printf("%d %d\n", a, b); - } - for (int i = 0; i < q; i++) { - int t = gen.uniform(0, 1); - printf("%d ", t); - if (t == 0) { - int p = gen.uniform(0, n - 1); - int c = gen.uniform(1, 998244352); - int d = gen.uniform(0, 998244352); - printf("%d %d %d\n", p, c, d); - } else { - auto p = gen.uniform_pair(0, n); - int x = gen.uniform(0, 998244352); - printf("%d %d %d\n", p.first, p.second, x); - } - } - return 0; -} From a772f36d2a3e999d05fbcc3822570c5fecc6baa0 Mon Sep 17 00:00:00 2001 From: maspypy <45988013+maspypy@users.noreply.github.com> Date: Tue, 12 Nov 2024 03:03:28 +0900 Subject: [PATCH 3/6] Update data_structure/point_set_range_composite_large_array/task.md Co-authored-by: NachiaVivias <71425187+NachiaVivias@users.noreply.github.com> --- data_structure/point_set_range_composite_large_array/task.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data_structure/point_set_range_composite_large_array/task.md b/data_structure/point_set_range_composite_large_array/task.md index 7fd0b3cb2..1a4343542 100644 --- a/data_structure/point_set_range_composite_large_array/task.md +++ b/data_structure/point_set_range_composite_large_array/task.md @@ -18,8 +18,8 @@ Given a size $N$ sequence of linear functions $f_0, f_1, ..., f_{N-1}$. Initiall - $1 \leq N \leq @{param.N_MAX}$ - $1 \leq Q \leq @{param.Q_MAX}$ -- $1 \leq a_i, c < @{param.MOD}$ -- $0 \leq b_i, d, x < @{param.MOD}$ +- $1 \leq c < @{param.MOD}$ +- $0 \leq d, x < @{param.MOD}$ - $0 \leq p < N$ - $0 \leq l < r \leq N$ From 13ebb5f730e95a377c5f9a5abb5694df43677ccb Mon Sep 17 00:00:00 2001 From: maspypy Date: Tue, 12 Nov 2024 03:13:15 +0900 Subject: [PATCH 4/6] Q=500000 --- .../hash.json | 84 +++++++++---------- .../info.toml | 2 +- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/data_structure/point_set_range_composite_large_array/hash.json b/data_structure/point_set_range_composite_large_array/hash.json index e3b3cf9a1..f9f069c87 100644 --- a/data_structure/point_set_range_composite_large_array/hash.json +++ b/data_structure/point_set_range_composite_large_array/hash.json @@ -1,52 +1,52 @@ { - "dense_00.in": "25ff5ac450c9dab241779df665c4b43c1c0830a216213d1b5f86a5d6929a2406", - "dense_00.out": "3b9f058a71b3a6dd25f3fe603c26868aedaef50ff326f46926c022011654aac7", - "dense_01.in": "6a15dace7009eeafa28cbe86bac75d974a6c8b8cae2ac10e6a6483caf6525942", - "dense_01.out": "6fa53805886de9e741d15adae85278aad219b68e0026251a97c1de82feb77293", - "dense_02.in": "c2549ebfdf28f568ab1fa9ca86a12628982c1a35e99656906d4196b4e4ec9ad5", - "dense_02.out": "a594ed50faded567179fc9972f110a720a6b830f8037611cd93541087ea8f446", + "dense_00.in": "aac0bc3bbb873579fc2894cbe32a5f45359d1e967bc89fa59456f75a97e33c2c", + "dense_00.out": "a3e7bd103cc9601ab276f7227165c5d607c6f2ce27dde0aa36fe4eba5ce36a88", + "dense_01.in": "18b0eb5884155b47b102aace2a4be82dbe3aebc89dde018c0f29c24febd82537", + "dense_01.out": "180eea4034b9c90a5125366d21a7e03b2edec05a7372d82111215e1c63be84a8", + "dense_02.in": "10fa267696065717f5b7ab7d6813a79805d5e38622bbe5aad30ca31376c170e2", + "dense_02.out": "ecddb91a86a66cda99e4fe6754e4b4e570c8dabc1bf8e74721986e15b9ee2742", "example_00.in": "3512449209bf077afb69df94260a1135d3d71458c6a742170c4bbfc41fbfcb1e", "example_00.out": "432f365abd0d9d7b9b67b6b0be5fa0bd2940ee4f9df0d2cbc318658f7aeea7af", - "many_query_0_00.in": "266aaa62a2037ae6556dc010f2b33a2e7bcdde112e07f3cbafddfa5abdc77776", - "many_query_0_00.out": "957d4cb6f98ccbb2a22fa82f5c724760e82788cc9aa82f337abe1782b2b115fe", - "many_query_0_01.in": "e48f4d8c173a2462e4a1f9068ea91ec536156f4e0d54ba52179bd78878ce7daa", - "many_query_0_01.out": "340f4de09ac0e70edd04a0a497b2c8dd3f26ce6f4b685fad1871ad789bf86fd3", - "many_query_1_00.in": "2b5fb31f964929d1101330fc8179b3701da6307a06e722d075fe6edf50ef9c4d", - "many_query_1_00.out": "33209df1e49a46812e9a5ce0bf30439653166ea86328114c940c22dddda88ccf", - "many_query_1_01.in": "5be003bd7b59ac03cdf4f4565b7aea7353fbe2f7cc9eb5582b9b529cced7295b", - "many_query_1_01.out": "7256e8aa0a56f3c515529042e2ccd52543ab337602428294c9ac64973a8bd16a", - "max_random_00.in": "1a46cf6763ba23954514bfec31dbc91fb1c3eb392b3783a115e9c6ff045a3cab", - "max_random_00.out": "8734ffdd631ac7601439c42efc1d51f3c4a0d753f749a8145d175415bad1ddfc", - "max_random_01.in": "9e294cfe7036a6d55c35bbb4b5be0b985e5f86c94c1b7fdc25163f4aab070af6", - "max_random_01.out": "e3d7c2c4c12cdf4d221be54693205af3cb7706db71ac385e754822065ae3baeb", - "max_random_02.in": "986e29118925b5ac8eeeac69b2815cc2db850b49f11496dbff390325061b8517", - "max_random_02.out": "3542acd63b61e6f291f3ceb78e0c1d72b8d16b6720a49e1062ae70f00dd3dd52", - "near_0_and_N_00.in": "4209c9020ee5dc1cd501562fab35d5bc4fc50ff0a3991eb1dd2d4b04ff2064a9", - "near_0_and_N_00.out": "19371ff3745ba4d4387389510f78c5083b666c14d43e838122ce1bc87655903c", - "near_0_and_N_01.in": "c26f31ea8e4bbd64e1218c3d385c4a44a388b55da5431d85dc35858389fc3cb2", - "near_0_and_N_01.out": "bff7e21a06d0c636bf85443f9b6a69d75a8a03b3a1aa6785206458021d9da38d", - "query_0_then_1_00.in": "30e106f17b1894f82e8e80f508a0fc50c7d81ff94754d320d8ed8efbd1507060", - "query_0_then_1_00.out": "75546d55713b91a363c6c4fe438330e3fa718e63aeb072547e94552f47b47627", - "query_0_then_1_01.in": "5598fa921a50c5550a272dab6af779c86d183b270d82a2804d3087ea50c392ef", - "query_0_then_1_01.out": "0e24b7a6b9ded346d2b8a78839aa327f5276ad2ce9b63784ecbd5ca3a20ec220", + "many_query_0_00.in": "ab4b634bbee0f03054909e740d7a39aba0de6573ba11f7cd58487024f4088f96", + "many_query_0_00.out": "538e614084fd09ea95df9ffe0b89bf0d7cbe911fbf672d3c257a2eb30c63f0d7", + "many_query_0_01.in": "d597cb8ca0be4a15dffe8f3aa197f54447633995c973ff24ed09fd38e16d1dfc", + "many_query_0_01.out": "386d40ce39f92413a092e60a4243dd325d6b7cfe820497ef2d5f5967c8371f84", + "many_query_1_00.in": "d4e3cc6f8691bf612afb4d7613d6302c095706e510d2b6c7546d3f0295f6b456", + "many_query_1_00.out": "4097c275626452fd3c77f983fa1ba0a2197c321aeda5ba28030261efd1a4a025", + "many_query_1_01.in": "fc7e3328fb021e37a05653a78a25834c09c013cd04e2757976d9a145bcd68dae", + "many_query_1_01.out": "4700856c439519117706340cfb1b0e4c2c8712036d6a8df4f9cc2de1de164c5b", + "max_random_00.in": "829619b6ab6cf8c2ce59ab19fa8bae31305a0719788c0ee49b5bb4b5a24faf92", + "max_random_00.out": "40e12623bc9b2f3d3717c0cf70cac2e1462732d6411eb71f4bd335b72efb273d", + "max_random_01.in": "d50bb497ddcafa950f172d10b5a3f5000ae741f59cf851281c5dd598e69e000c", + "max_random_01.out": "e8b5a3a94efa4a28cbc3d663f206a7eec410d29ad305f0af658e7d4fcefd8146", + "max_random_02.in": "2801f71e2fa577682e301523b42de75040ef7b90d818a635ea4108ac7f98b026", + "max_random_02.out": "4ead287c82a575cbbadf881449b495959af81dda125f90e99c17f590d46a92a0", + "near_0_and_N_00.in": "2d36aefba480ec9eeeb0c80faf54b55e89db99627937aae9c83ce3dc73fb999c", + "near_0_and_N_00.out": "ab402cc84a296d3d158659a42d50b2b5c0c8008bd4e04778949e9e8d90eda595", + "near_0_and_N_01.in": "83ba7d1d5f7b3949bafafa429c51e47b7bc030bb8ad2263de1bf65a1c9d88c3a", + "near_0_and_N_01.out": "e9bc968856e780f536963fb4cf26f7dcd5bb05e70ef80e8847f540c116610935", + "query_0_then_1_00.in": "bfb2ab64c42a518c99e1a51a9dd6b4dbbaf5951b2171eaf176019b38fd26a393", + "query_0_then_1_00.out": "6c0b9bbf74d47dcab6cf98aa64b9fbc7054d8d38e55f305de447ba8df88a6def", + "query_0_then_1_01.in": "57c32fb9eba0bdb0e82d0ed706f75cb98f878b2562db41e047eca17923217e0b", + "query_0_then_1_01.out": "386a289329af425faee18e74c8335eb2a7ffcb41d41d5bf6f02b6a0ff3e61e6a", "random_00.in": "3bf06d96dcd52541fee71fee92ec2f90f260dc3336f047c33c8ffd7b650061ee", "random_00.out": "b44acfd213f368ab5076c8331bd3600ad0b4a51cfd2a1dc64120d27cf3f3ae67", "random_01.in": "9a1d7f7bd483b61408bd166049dba2b9b3feb14db82be3d8650712697538c6d4", "random_01.out": "613b95068e00f605fb824b2ee6146c7d41b20655f6526de39c6d58f3a9f01283", - "random_02.in": "a5916633e2255d79686ee44b2f6da490b3c42d4169943529b09d7b98c8734d10", - "random_02.out": "33181ac48e3e36c50c01bc8e6ebe70fe1171e375c056a4d2e342b4c2b32a0d34", - "random_03.in": "c08e9629f597de496635ccddcb0ff789a3e0c1b3f6d6361f2117f2c51fcef88c", - "random_03.out": "5120455fe65941c15d39da26fa29b581b625e88d48649ad54b2d0c54f4e1e63c", + "random_02.in": "d24aba145518593da122ec294f6d275f57381da35016f4676920eeb95c92e13d", + "random_02.out": "e7d04219b3950ab6e9762d46fe1f4d2364a6cb35d54a2f80d3a43ae0e7f665f0", + "random_03.in": "2594af7af2cc85800b611c7a3a457698828bf24b171d14c20d75a88b21ef63e5", + "random_03.out": "5c9a138d0766ee386499e0b50d62d0d194a36e38c40070d29efcfb59c126b162", "random_04.in": "70c753a91c0bec8a07f1fe75be82775310ba36369f730cf954734b4fe3f61723", "random_04.out": "e38e6f3c743f669247e5caa8e75467ce86646efb87074b16febface9927c9caf", - "small_N_00.in": "6e9c2c2fdaf8f957fa55d210bac5512f4c93d60ee14dcc65c73b2b3c28dd8999", - "small_N_00.out": "2ccb852951af03e329b1a7582e551246ee8fb4be110d217f48a56865e7357a91", - "small_N_01.in": "e049bd10c4a749d461e43c10f72f5e7f79aaa91b5294022fafa2c03aefa39117", - "small_N_01.out": "e9487d9416002c18b55d1b15e47300d278516e703e3264e9d9218d7aede7c06c", - "small_N_02.in": "358ea7f4b08c464368d1a678fdec1768867c08f231e3d49123a92a2993b25f9d", - "small_N_02.out": "2d91f57da5c15f7024962937601c5ca4da02df3faca0a06b8bd799b4a50e93ad", - "small_N_03.in": "48fd3ca0b624c2b0e235b2f3fdcf86a6f813ac7fe673b6ddf245c339188d85ef", - "small_N_03.out": "357450158e748ae0aa157b200a557dff2003828082d147bcd7483be5e39a4a3a", - "small_N_04.in": "7ae72374ef9269f4ca38ad2e3f3736a8ed25b426be8bc3c92fade9503383875f", - "small_N_04.out": "61f740e46c27c08f57b514b421d21135f03876401a51a2c76c3cf10e4710386a" + "small_N_00.in": "894d52db171eaf2d15f05827093edad677b8c8999b5838d7723d18d174f339a2", + "small_N_00.out": "7c0343509b33e615bd862f81d4b68858dc7ab78865745194fd35b628acf0da7e", + "small_N_01.in": "c6922ce16091800c0c6051daa466217095059fd9a193f40a38a7e8e19eeeba32", + "small_N_01.out": "fa78f1d87fc011e7dbaf1e573dbd7dfff735bed3b8e62be35b0113cc0e330964", + "small_N_02.in": "5f8237d1e8301fb607099a808729bb8bf70e9df1a955edfb87d319ddae4fb334", + "small_N_02.out": "ae1e29c91eddabafa19fc22c13606173119be2014b600882a21feb4ea2a84913", + "small_N_03.in": "1d495649f1cc7bcde7623f4f0c77d8eeaefa84f9b88fdd52dd46729dd04b3c71", + "small_N_03.out": "229a6440c0616a8ff07513f52f23d6ccd8b3ad420e59c3ac4fdc3980b264479b", + "small_N_04.in": "98c4f2597aa77cc486a19ea477997f33303d9ad82ff205534c7589dd60ed7507", + "small_N_04.out": "a4d32241a272c121eea168ee8a433a1662c7ae3a41e994b807eae73a6193e3be" } \ No newline at end of file diff --git a/data_structure/point_set_range_composite_large_array/info.toml b/data_structure/point_set_range_composite_large_array/info.toml index f20866f24..5b29193d1 100644 --- a/data_structure/point_set_range_composite_large_array/info.toml +++ b/data_structure/point_set_range_composite_large_array/info.toml @@ -41,5 +41,5 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/828" [params] N_MAX = 1_000_000_000 - Q_MAX = 1_000_000 + Q_MAX = 500_000 MOD = 998244353 From 870f616eee1f7e27dbca473d0da13fedbbf1cfaf Mon Sep 17 00:00:00 2001 From: maspypy <45988013+maspypy@users.noreply.github.com> Date: Tue, 12 Nov 2024 03:14:54 +0900 Subject: [PATCH 5/6] Update dense.cpp --- .../point_set_range_composite_large_array/gen/dense.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_structure/point_set_range_composite_large_array/gen/dense.cpp b/data_structure/point_set_range_composite_large_array/gen/dense.cpp index 9fddb634f..3acf5e9b1 100644 --- a/data_structure/point_set_range_composite_large_array/gen/dense.cpp +++ b/data_structure/point_set_range_composite_large_array/gen/dense.cpp @@ -12,7 +12,7 @@ int main(int, char* argv[]) { int q = Q_MAX; printf("%d %d\n", n, q); - int ws[] = {1, 1000, 1000000}; + int ws[] = {1, 1000, 500000}; int w = ws[seed % 3]; int L = gen.uniform(0, n - w); From 86d04f8e645b15aa3b276c38dc104d1b270059b6 Mon Sep 17 00:00:00 2001 From: maspypy Date: Tue, 12 Nov 2024 03:16:50 +0900 Subject: [PATCH 6/6] hash --- .../point_set_range_composite_large_array/hash.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data_structure/point_set_range_composite_large_array/hash.json b/data_structure/point_set_range_composite_large_array/hash.json index f9f069c87..f9532d258 100644 --- a/data_structure/point_set_range_composite_large_array/hash.json +++ b/data_structure/point_set_range_composite_large_array/hash.json @@ -3,8 +3,8 @@ "dense_00.out": "a3e7bd103cc9601ab276f7227165c5d607c6f2ce27dde0aa36fe4eba5ce36a88", "dense_01.in": "18b0eb5884155b47b102aace2a4be82dbe3aebc89dde018c0f29c24febd82537", "dense_01.out": "180eea4034b9c90a5125366d21a7e03b2edec05a7372d82111215e1c63be84a8", - "dense_02.in": "10fa267696065717f5b7ab7d6813a79805d5e38622bbe5aad30ca31376c170e2", - "dense_02.out": "ecddb91a86a66cda99e4fe6754e4b4e570c8dabc1bf8e74721986e15b9ee2742", + "dense_02.in": "05434bcaf19613ab1103544cc6c11e6bc84df8cb36a6fe46cdfa277318b80d03", + "dense_02.out": "9f7ab8d838c5ebffe0c1693847e520d8e68d964ba5520a86e16998f0376edf69", "example_00.in": "3512449209bf077afb69df94260a1135d3d71458c6a742170c4bbfc41fbfcb1e", "example_00.out": "432f365abd0d9d7b9b67b6b0be5fa0bd2940ee4f9df0d2cbc318658f7aeea7af", "many_query_0_00.in": "ab4b634bbee0f03054909e740d7a39aba0de6573ba11f7cd58487024f4088f96",