From 9259be111367db7eaca610c47d408ad3e774c7fa Mon Sep 17 00:00:00 2001 From: ia7ck <23146842+ia7ck@users.noreply.github.com> Date: Sun, 25 Oct 2026 00:08:40 +0900 Subject: [PATCH] mit --- LICENSE | 122 +------------- libs/arg_cmp/Cargo.toml | 2 +- libs/arithmetic_series/Cargo.toml | 2 +- libs/auxiliary_tree/Cargo.toml | 2 +- libs/avl_tree/Cargo.toml | 2 +- libs/binary_search_range/Cargo.toml | 2 +- libs/detect_cycle/Cargo.toml | 2 +- libs/dijkstra/Cargo.toml | 2 +- libs/disjoint_intervals/Cargo.toml | 2 +- libs/divisors/Cargo.toml | 2 +- libs/doubling/Cargo.toml | 2 +- libs/ext_gcd/Cargo.toml | 2 +- libs/factorials/Cargo.toml | 2 +- libs/fenwick_tree/Cargo.toml | 2 +- libs/floor_sqrt/Cargo.toml | 2 +- libs/graph/Cargo.toml | 2 +- libs/grid_search/Cargo.toml | 2 +- libs/least_prime_factors/Cargo.toml | 2 +- libs/lowest_common_ancestor/Cargo.toml | 2 +- libs/mod_int/Cargo.toml | 2 +- libs/next_permutation/Cargo.toml | 2 +- libs/pascal_triangle/Cargo.toml | 2 +- libs/prefix_sum/Cargo.toml | 2 +- libs/prime_factorization/Cargo.toml | 2 +- libs/re_rooting_dp/Cargo.toml | 2 +- libs/rolling_hash/Cargo.toml | 2 +- libs/run_length/Cargo.toml | 2 +- libs/scanner/Cargo.toml | 2 +- libs/segment_tree/Cargo.toml | 2 +- libs/sliding_window/Cargo.toml | 2 +- libs/strongly_connected_components/Cargo.toml | 2 +- libs/suffix_array/Cargo.toml | 13 -- .../examples/number_of_substrings.rs | 16 -- libs/suffix_array/examples/suffixarray.rs | 20 --- libs/suffix_array/src/lib.rs | 154 ------------------ libs/topological_sort/Cargo.toml | 2 +- libs/treap/Cargo.toml | 2 +- libs/tree_diameter/Cargo.toml | 2 +- libs/union_find/Cargo.toml | 2 +- libs/z_algorithm/Cargo.toml | 2 +- libs/zarts/Cargo.toml | 2 +- tool/bundle/Cargo.toml | 2 +- tool/oj_test/Cargo.toml | 2 +- .../simple_example/Cargo.toml | 2 +- .../special_judge_example/Cargo.toml | 2 +- 45 files changed, 44 insertions(+), 361 deletions(-) delete mode 100644 libs/suffix_array/Cargo.toml delete mode 100644 libs/suffix_array/examples/number_of_substrings.rs delete mode 100644 libs/suffix_array/examples/suffixarray.rs delete mode 100644 libs/suffix_array/src/lib.rs diff --git a/LICENSE b/LICENSE index 0e259d42..850fbe0e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,121 +1,7 @@ -Creative Commons Legal Code +MIT No Attribution -CC0 1.0 Universal +Copyright 2026 ia7ck - CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE - LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN - ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS - INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES - REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS - PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM - THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED - HEREUNDER. +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. -Statement of Purpose - -The laws of most jurisdictions throughout the world automatically confer -exclusive Copyright and Related Rights (defined below) upon the creator -and subsequent owner(s) (each and all, an "owner") of an original work of -authorship and/or a database (each, a "Work"). - -Certain owners wish to permanently relinquish those rights to a Work for -the purpose of contributing to a commons of creative, cultural and -scientific works ("Commons") that the public can reliably and without fear -of later claims of infringement build upon, modify, incorporate in other -works, reuse and redistribute as freely as possible in any form whatsoever -and for any purposes, including without limitation commercial purposes. -These owners may contribute to the Commons to promote the ideal of a free -culture and the further production of creative, cultural and scientific -works, or to gain reputation or greater distribution for their Work in -part through the use and efforts of others. - -For these and/or other purposes and motivations, and without any -expectation of additional consideration or compensation, the person -associating CC0 with a Work (the "Affirmer"), to the extent that he or she -is an owner of Copyright and Related Rights in the Work, voluntarily -elects to apply CC0 to the Work and publicly distribute the Work under its -terms, with knowledge of his or her Copyright and Related Rights in the -Work and the meaning and intended legal effect of CC0 on those rights. - -1. Copyright and Related Rights. A Work made available under CC0 may be -protected by copyright and related or neighboring rights ("Copyright and -Related Rights"). Copyright and Related Rights include, but are not -limited to, the following: - - i. the right to reproduce, adapt, distribute, perform, display, - communicate, and translate a Work; - ii. moral rights retained by the original author(s) and/or performer(s); -iii. publicity and privacy rights pertaining to a person's image or - likeness depicted in a Work; - iv. rights protecting against unfair competition in regards to a Work, - subject to the limitations in paragraph 4(a), below; - v. rights protecting the extraction, dissemination, use and reuse of data - in a Work; - vi. database rights (such as those arising under Directive 96/9/EC of the - European Parliament and of the Council of 11 March 1996 on the legal - protection of databases, and under any national implementation - thereof, including any amended or successor version of such - directive); and -vii. other similar, equivalent or corresponding rights throughout the - world based on applicable law or treaty, and any national - implementations thereof. - -2. Waiver. To the greatest extent permitted by, but not in contravention -of, applicable law, Affirmer hereby overtly, fully, permanently, -irrevocably and unconditionally waives, abandons, and surrenders all of -Affirmer's Copyright and Related Rights and associated claims and causes -of action, whether now known or unknown (including existing as well as -future claims and causes of action), in the Work (i) in all territories -worldwide, (ii) for the maximum duration provided by applicable law or -treaty (including future time extensions), (iii) in any current or future -medium and for any number of copies, and (iv) for any purpose whatsoever, -including without limitation commercial, advertising or promotional -purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each -member of the public at large and to the detriment of Affirmer's heirs and -successors, fully intending that such Waiver shall not be subject to -revocation, rescission, cancellation, termination, or any other legal or -equitable action to disrupt the quiet enjoyment of the Work by the public -as contemplated by Affirmer's express Statement of Purpose. - -3. Public License Fallback. Should any part of the Waiver for any reason -be judged legally invalid or ineffective under applicable law, then the -Waiver shall be preserved to the maximum extent permitted taking into -account Affirmer's express Statement of Purpose. In addition, to the -extent the Waiver is so judged Affirmer hereby grants to each affected -person a royalty-free, non transferable, non sublicensable, non exclusive, -irrevocable and unconditional license to exercise Affirmer's Copyright and -Related Rights in the Work (i) in all territories worldwide, (ii) for the -maximum duration provided by applicable law or treaty (including future -time extensions), (iii) in any current or future medium and for any number -of copies, and (iv) for any purpose whatsoever, including without -limitation commercial, advertising or promotional purposes (the -"License"). The License shall be deemed effective as of the date CC0 was -applied by Affirmer to the Work. Should any part of the License for any -reason be judged legally invalid or ineffective under applicable law, such -partial invalidity or ineffectiveness shall not invalidate the remainder -of the License, and in such case Affirmer hereby affirms that he or she -will not (i) exercise any of his or her remaining Copyright and Related -Rights in the Work or (ii) assert any associated claims and causes of -action with respect to the Work, in either case contrary to Affirmer's -express Statement of Purpose. - -4. Limitations and Disclaimers. - - a. No trademark or patent rights held by Affirmer are waived, abandoned, - surrendered, licensed or otherwise affected by this document. - b. Affirmer offers the Work as-is and makes no representations or - warranties of any kind concerning the Work, express, implied, - statutory or otherwise, including without limitation warranties of - title, merchantability, fitness for a particular purpose, non - infringement, or the absence of latent or other defects, accuracy, or - the present or absence of errors, whether or not discoverable, all to - the greatest extent permissible under applicable law. - c. Affirmer disclaims responsibility for clearing rights of other persons - that may apply to the Work or any use thereof, including without - limitation any person's Copyright and Related Rights in the Work. - Further, Affirmer disclaims responsibility for obtaining any necessary - consents, permissions or other rights required for any use of the - Work. - d. Affirmer understands and acknowledges that Creative Commons is not a - party to this document and has no duty or obligation with respect to - this CC0 or use of the Work. +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. diff --git a/libs/arg_cmp/Cargo.toml b/libs/arg_cmp/Cargo.toml index 1d540799..65f557a9 100644 --- a/libs/arg_cmp/Cargo.toml +++ b/libs/arg_cmp/Cargo.toml @@ -3,7 +3,7 @@ name = "arg_cmp" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/arithmetic_series/Cargo.toml b/libs/arithmetic_series/Cargo.toml index 02cb665f..a5ca05c1 100644 --- a/libs/arithmetic_series/Cargo.toml +++ b/libs/arithmetic_series/Cargo.toml @@ -3,7 +3,7 @@ name = "arithmetic_series" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/auxiliary_tree/Cargo.toml b/libs/auxiliary_tree/Cargo.toml index 1f85eb0b..bd006940 100644 --- a/libs/auxiliary_tree/Cargo.toml +++ b/libs/auxiliary_tree/Cargo.toml @@ -3,7 +3,7 @@ name = "auxiliary_tree" version = "0.1.0" edition = "2024" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/avl_tree/Cargo.toml b/libs/avl_tree/Cargo.toml index 1144905c..f6345a5e 100644 --- a/libs/avl_tree/Cargo.toml +++ b/libs/avl_tree/Cargo.toml @@ -3,7 +3,7 @@ name = "avl_tree" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/binary_search_range/Cargo.toml b/libs/binary_search_range/Cargo.toml index b64b2add..5739093b 100644 --- a/libs/binary_search_range/Cargo.toml +++ b/libs/binary_search_range/Cargo.toml @@ -3,7 +3,7 @@ name = "binary_search_range" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/detect_cycle/Cargo.toml b/libs/detect_cycle/Cargo.toml index 4fd3361d..21030123 100644 --- a/libs/detect_cycle/Cargo.toml +++ b/libs/detect_cycle/Cargo.toml @@ -3,7 +3,7 @@ name = "detect_cycle" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/dijkstra/Cargo.toml b/libs/dijkstra/Cargo.toml index 75883d46..abdf290e 100644 --- a/libs/dijkstra/Cargo.toml +++ b/libs/dijkstra/Cargo.toml @@ -3,7 +3,7 @@ name = "dijkstra" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/disjoint_intervals/Cargo.toml b/libs/disjoint_intervals/Cargo.toml index f58008b1..5c51c24b 100644 --- a/libs/disjoint_intervals/Cargo.toml +++ b/libs/disjoint_intervals/Cargo.toml @@ -3,7 +3,7 @@ name = "disjoint_intervals" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/divisors/Cargo.toml b/libs/divisors/Cargo.toml index 27865cf9..703323de 100644 --- a/libs/divisors/Cargo.toml +++ b/libs/divisors/Cargo.toml @@ -3,7 +3,7 @@ name = "divisors" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/doubling/Cargo.toml b/libs/doubling/Cargo.toml index ef95b3e5..7a25cd2b 100644 --- a/libs/doubling/Cargo.toml +++ b/libs/doubling/Cargo.toml @@ -3,7 +3,7 @@ name = "doubling" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/ext_gcd/Cargo.toml b/libs/ext_gcd/Cargo.toml index 62a2ed26..b9ff19df 100644 --- a/libs/ext_gcd/Cargo.toml +++ b/libs/ext_gcd/Cargo.toml @@ -3,7 +3,7 @@ name = "ext_gcd" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/factorials/Cargo.toml b/libs/factorials/Cargo.toml index 2a012eba..de043ab8 100644 --- a/libs/factorials/Cargo.toml +++ b/libs/factorials/Cargo.toml @@ -3,7 +3,7 @@ name = "factorials" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/fenwick_tree/Cargo.toml b/libs/fenwick_tree/Cargo.toml index 041e67a7..00976f24 100644 --- a/libs/fenwick_tree/Cargo.toml +++ b/libs/fenwick_tree/Cargo.toml @@ -3,7 +3,7 @@ name = "fenwick_tree" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/floor_sqrt/Cargo.toml b/libs/floor_sqrt/Cargo.toml index f40a12dd..6641f12d 100644 --- a/libs/floor_sqrt/Cargo.toml +++ b/libs/floor_sqrt/Cargo.toml @@ -3,7 +3,7 @@ name = "floor_sqrt" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/graph/Cargo.toml b/libs/graph/Cargo.toml index fcc4aee1..0c085031 100644 --- a/libs/graph/Cargo.toml +++ b/libs/graph/Cargo.toml @@ -3,7 +3,7 @@ name = "graph" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/grid_search/Cargo.toml b/libs/grid_search/Cargo.toml index 6582f8d2..f6dc0b2b 100644 --- a/libs/grid_search/Cargo.toml +++ b/libs/grid_search/Cargo.toml @@ -3,7 +3,7 @@ name = "grid_search" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/least_prime_factors/Cargo.toml b/libs/least_prime_factors/Cargo.toml index c98982c5..43a4814e 100644 --- a/libs/least_prime_factors/Cargo.toml +++ b/libs/least_prime_factors/Cargo.toml @@ -3,7 +3,7 @@ name = "least_prime_factors" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/lowest_common_ancestor/Cargo.toml b/libs/lowest_common_ancestor/Cargo.toml index 4bf91029..7563fd9d 100644 --- a/libs/lowest_common_ancestor/Cargo.toml +++ b/libs/lowest_common_ancestor/Cargo.toml @@ -3,7 +3,7 @@ name = "lowest_common_ancestor" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/mod_int/Cargo.toml b/libs/mod_int/Cargo.toml index 8a369177..26a44879 100644 --- a/libs/mod_int/Cargo.toml +++ b/libs/mod_int/Cargo.toml @@ -3,7 +3,7 @@ name = "mod_int" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/next_permutation/Cargo.toml b/libs/next_permutation/Cargo.toml index 9c516533..8b4c6ea7 100644 --- a/libs/next_permutation/Cargo.toml +++ b/libs/next_permutation/Cargo.toml @@ -3,7 +3,7 @@ name = "next_permutation" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/pascal_triangle/Cargo.toml b/libs/pascal_triangle/Cargo.toml index 03c21b0c..3ac409f8 100644 --- a/libs/pascal_triangle/Cargo.toml +++ b/libs/pascal_triangle/Cargo.toml @@ -3,7 +3,7 @@ name = "pascal_triangle" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/prefix_sum/Cargo.toml b/libs/prefix_sum/Cargo.toml index 294b5640..e1f3329c 100644 --- a/libs/prefix_sum/Cargo.toml +++ b/libs/prefix_sum/Cargo.toml @@ -3,7 +3,7 @@ name = "prefix_sum" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/prime_factorization/Cargo.toml b/libs/prime_factorization/Cargo.toml index 25f78c59..c5c40499 100644 --- a/libs/prime_factorization/Cargo.toml +++ b/libs/prime_factorization/Cargo.toml @@ -3,7 +3,7 @@ name = "prime_factorization" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/re_rooting_dp/Cargo.toml b/libs/re_rooting_dp/Cargo.toml index 354a3f78..590f817b 100644 --- a/libs/re_rooting_dp/Cargo.toml +++ b/libs/re_rooting_dp/Cargo.toml @@ -3,7 +3,7 @@ name = "re_rooting_dp" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/rolling_hash/Cargo.toml b/libs/rolling_hash/Cargo.toml index 34c1f536..16889236 100644 --- a/libs/rolling_hash/Cargo.toml +++ b/libs/rolling_hash/Cargo.toml @@ -3,7 +3,7 @@ name = "rolling_hash" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/run_length/Cargo.toml b/libs/run_length/Cargo.toml index 91646399..375eaa67 100644 --- a/libs/run_length/Cargo.toml +++ b/libs/run_length/Cargo.toml @@ -3,7 +3,7 @@ name = "run_length" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/scanner/Cargo.toml b/libs/scanner/Cargo.toml index 50cb703f..7d3976e0 100644 --- a/libs/scanner/Cargo.toml +++ b/libs/scanner/Cargo.toml @@ -3,7 +3,7 @@ name = "scanner" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/segment_tree/Cargo.toml b/libs/segment_tree/Cargo.toml index 00bf73e7..471bd6ef 100644 --- a/libs/segment_tree/Cargo.toml +++ b/libs/segment_tree/Cargo.toml @@ -3,7 +3,7 @@ name = "segment_tree" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/sliding_window/Cargo.toml b/libs/sliding_window/Cargo.toml index 2e894365..30c9a6b3 100644 --- a/libs/sliding_window/Cargo.toml +++ b/libs/sliding_window/Cargo.toml @@ -3,7 +3,7 @@ name = "sliding_window" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/strongly_connected_components/Cargo.toml b/libs/strongly_connected_components/Cargo.toml index 424b10c4..aa89b858 100644 --- a/libs/strongly_connected_components/Cargo.toml +++ b/libs/strongly_connected_components/Cargo.toml @@ -3,7 +3,7 @@ name = "strongly_connected_components" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/suffix_array/Cargo.toml b/libs/suffix_array/Cargo.toml deleted file mode 100644 index 32abbbcc..00000000 --- a/libs/suffix_array/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "suffix_array" -version = "0.1.0" -authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] -edition = "2024" -license = "CC0-1.0" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] - -[dev-dependencies] -proconio = {version = "0.4.5", features = ["derive"] } diff --git a/libs/suffix_array/examples/number_of_substrings.rs b/libs/suffix_array/examples/number_of_substrings.rs deleted file mode 100644 index 7f9b1478..00000000 --- a/libs/suffix_array/examples/number_of_substrings.rs +++ /dev/null @@ -1,16 +0,0 @@ -// problem: https://judge.yosupo.jp/problem/number_of_substrings -use proconio::marker::Chars; -use proconio::{fastout, input}; -use suffix_array::{lcp_array, suffix_array}; - -#[fastout] -fn main() { - input! { - s: Chars, - } - - let sa = suffix_array(&s); - let lcp = lcp_array(&s, &sa); - let ans = s.len() * (s.len() + 1) / 2 - lcp.iter().sum::(); - println!("{}", ans); -} diff --git a/libs/suffix_array/examples/suffixarray.rs b/libs/suffix_array/examples/suffixarray.rs deleted file mode 100644 index b4d850fe..00000000 --- a/libs/suffix_array/examples/suffixarray.rs +++ /dev/null @@ -1,20 +0,0 @@ -// problem: https://judge.yosupo.jp/problem/suffixarray -use proconio::marker::Chars; -use proconio::{fastout, input}; -use suffix_array::suffix_array; - -#[fastout] -fn main() { - input! { - s: Chars, - } - - let sa = suffix_array(&s); - println!( - "{}", - sa.iter() - .map(|sa| sa.to_string()) - .collect::>() - .join(" ") - ); -} diff --git a/libs/suffix_array/src/lib.rs b/libs/suffix_array/src/lib.rs deleted file mode 100644 index 51c95f66..00000000 --- a/libs/suffix_array/src/lib.rs +++ /dev/null @@ -1,154 +0,0 @@ -fn sort_cyclic_shifts(s: &[char]) -> Vec { - let n = s.len(); - const ALPHABET: usize = 256; - let mut cnt = vec![0; n.max(ALPHABET)]; - for &ch in s { - cnt[ch as usize] += 1; - } - for i in 1..ALPHABET { - cnt[i] += cnt[i - 1]; - } - let mut p = vec![!0; n]; - // p[i] := the index of the i-th substring (starting at i and with length 2^k) in the sorted order - for (i, &ch) in s.iter().enumerate().rev() { - cnt[ch as usize] -= 1; - p[cnt[ch as usize]] = i; - } - let mut c = vec![!0; n]; - // c[i] := the equivalence class to which the substring belongs - c[p[0]] = 0; - let mut classes = 1; - for w in p.windows(2) { - let (prev, cur) = (w[0], w[1]); - if s[prev] != s[cur] { - classes += 1; - } - c[cur] = classes - 1; - } - for h in (0..).take_while(|&h| 1 << h < n) { - let pn: Vec = p.iter().copied().map(|x| (n + x - (1 << h)) % n).collect(); - #[allow(clippy::needless_range_loop)] - for i in 0..classes { - cnt[i] = 0; - } - for &x in &pn { - cnt[c[x]] += 1; - } - for i in 1..classes { - cnt[i] += cnt[i - 1]; - } - for &x in pn.iter().rev() { - cnt[c[x]] -= 1; - p[cnt[c[x]]] = x; - } - let mut cn = vec![!0; n]; - cn[p[0]] = 0; - classes = 1; - for w in p.windows(2) { - let (prev, cur) = ( - (c[w[0]], c[(w[0] + (1 << h)) % n]), - (c[w[1]], c[(w[1] + (1 << h)) % n]), - ); - if prev != cur { - classes += 1; - } - cn[w[1]] = classes - 1; - } - c = cn; - } - p -} - -/// 文字列 `s` の suffix array を O(|s|log|s|) で求めます。 -/// -/// 返り値は `s.len()` を `n` としたとき、長さ `n` のベクタ `sa` であり次の条件を満たすものです。 -/// -/// - `s[sa[i]..]` が `s` の `n` 個ある suffix のうち辞書順で `i` 番目である -/// -/// original: [CP-Algorithms](https://cp-algorithms.com/string/suffix-array.html) -/// -/// # Examples -/// ``` -/// use suffix_array::suffix_array; -/// let s: Vec = "mississippi".chars().collect(); -/// let sa = suffix_array(&s); -/// assert_eq!(sa, vec![10, 7, 4, 1, 0, 9, 8, 6, 3, 5, 2]); -/// // i -/// // ippi -/// // issippi -/// // ississippi -/// // mississippi -/// // pi -/// // ppi -/// // sippi -/// // sissippi -/// // ssippi -/// // ssissippi -/// ``` -pub fn suffix_array(s: &[char]) -> Vec { - let mut s = s.to_vec(); - s.push('$'); - let sorted_shifts = sort_cyclic_shifts(&s); - sorted_shifts[1..].to_vec() -} - -/// LCP 配列を O(|s|) で求めます。 -/// -/// 返り値は長さ `s.len() - 1` のベクタ `lcp` であり `lcp[i]` := `s[sa[i]..]` と `s[sa[i+1]..]` との最長共通接頭辞の長さ、です。 -/// -/// # Examples -/// ``` -/// use suffix_array::{suffix_array, lcp_array}; -/// let s: Vec = "mississippi".chars().collect(); -/// let sa = suffix_array(&s); -/// let lcp = lcp_array(&s, &sa); -/// assert_eq!(lcp, vec![1, 1, 4, 0, 0, 1, 0, 2, 1, 3]); -pub fn lcp_array(s: &[char], sa: &[usize]) -> Vec { - let n = sa.len(); - if n == 1 { - return vec![]; - } - let mut rank = vec![!0; n]; - for i in 0..n { - rank[sa[i]] = i; - } - let mut k = 0; - let mut lcp = vec![0; n - 1]; - for i in 0..n { - if rank[i] + 1 == n { - k = 0; - continue; - } - if k >= 1 { - k -= 1; - } - let j = sa[rank[i] + 1]; - while i + k < n && j + k < n && s[i + k] == s[j + k] { - k += 1; - } - lcp[rank[i]] = k; - } - lcp -} - -#[cfg(test)] -mod tests { - use crate::{lcp_array, suffix_array}; - - #[test] - fn test_small() { - let tests = vec![ - ("a", vec![0], vec![]), - ("aa", vec![1, 0], vec![1]), - ("abc", vec![0, 1, 2], vec![0, 0]), - ("aaba", vec![3, 0, 1, 2], vec![1, 1, 0]), - ("abaab", vec![2, 3, 0, 4, 1], vec![1, 2, 0, 1]), - ("dabbb", vec![1, 4, 3, 2, 0], vec![0, 1, 2, 0]), - ]; - for (s, sa, lcp) in tests { - let s: Vec = s.chars().collect(); - assert_eq!(suffix_array(&s), sa); - assert_eq!(lcp_array(&s, &suffix_array(&s)), lcp); - } - } -} diff --git a/libs/topological_sort/Cargo.toml b/libs/topological_sort/Cargo.toml index c61c7a71..91b5c412 100644 --- a/libs/topological_sort/Cargo.toml +++ b/libs/topological_sort/Cargo.toml @@ -3,7 +3,7 @@ name = "topological_sort" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/treap/Cargo.toml b/libs/treap/Cargo.toml index 1e476a75..0a7063f1 100644 --- a/libs/treap/Cargo.toml +++ b/libs/treap/Cargo.toml @@ -3,7 +3,7 @@ name = "treap" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/tree_diameter/Cargo.toml b/libs/tree_diameter/Cargo.toml index 74f3b4d5..37810aaf 100644 --- a/libs/tree_diameter/Cargo.toml +++ b/libs/tree_diameter/Cargo.toml @@ -3,7 +3,7 @@ name = "tree_diameter" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/union_find/Cargo.toml b/libs/union_find/Cargo.toml index 5997e263..aca20eef 100644 --- a/libs/union_find/Cargo.toml +++ b/libs/union_find/Cargo.toml @@ -3,7 +3,7 @@ name = "union_find" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/z_algorithm/Cargo.toml b/libs/z_algorithm/Cargo.toml index f3be8f72..a3bb342f 100644 --- a/libs/z_algorithm/Cargo.toml +++ b/libs/z_algorithm/Cargo.toml @@ -3,7 +3,7 @@ name = "z_algorithm" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libs/zarts/Cargo.toml b/libs/zarts/Cargo.toml index f972bf92..141e95f5 100644 --- a/libs/zarts/Cargo.toml +++ b/libs/zarts/Cargo.toml @@ -3,7 +3,7 @@ name = "zarts" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tool/bundle/Cargo.toml b/tool/bundle/Cargo.toml index 456cd265..df2bcd34 100644 --- a/tool/bundle/Cargo.toml +++ b/tool/bundle/Cargo.toml @@ -3,7 +3,7 @@ name = "bundle" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" [[bin]] name = "bundle-rs" diff --git a/tool/oj_test/Cargo.toml b/tool/oj_test/Cargo.toml index 7a47d262..cfaead17 100644 --- a/tool/oj_test/Cargo.toml +++ b/tool/oj_test/Cargo.toml @@ -3,7 +3,7 @@ name = "oj_test" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tool/oj_test_examples/simple_example/Cargo.toml b/tool/oj_test_examples/simple_example/Cargo.toml index 52f128b6..bf305b75 100644 --- a/tool/oj_test_examples/simple_example/Cargo.toml +++ b/tool/oj_test_examples/simple_example/Cargo.toml @@ -3,7 +3,7 @@ name = "simple_example" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tool/oj_test_examples/special_judge_example/Cargo.toml b/tool/oj_test_examples/special_judge_example/Cargo.toml index 8e0a55dd..4a04fea1 100644 --- a/tool/oj_test_examples/special_judge_example/Cargo.toml +++ b/tool/oj_test_examples/special_judge_example/Cargo.toml @@ -3,7 +3,7 @@ name = "special_judge_example" version = "0.1.0" authors = ["ia7ck <23146842+ia7ck@users.noreply.github.com>"] edition = "2024" -license = "CC0-1.0" +license = "MIT-0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html