Skip to content

Commit

Permalink
Merge pull request yosupo06#1250 from maspypy/1211
Browse files Browse the repository at this point in the history
テストケース追加(1211
  • Loading branch information
maspypy authored Sep 28, 2024
2 parents 4fb527c + 7aae27d commit e6bef87
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
50 changes: 50 additions & 0 deletions string/suffixarray/gen/almost_single.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include <iostream>
#include "random.h"
#include "../params.h"

using namespace std;

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

string S;
if (seed == 0) {
// issue 1211 hack_sft
S = string(499981, 't');
S[7122] = 's';
S[249980] = 'g';
S[374980] = 's';
S[437480] = 'w';
S[468730] = 'o';
S[484355] = 'q';
S[492167] = 'v';
S[496073] = 'k';
S[498026] = 'h';
S[499003] = 'p';
S[499491] = 'd';
S[499735] = 'z';
S[499857] = 'g';
S[499918] = 'a';
S[499949] = 'l';
S[499964] = 'z';
S[499972] = 'z';
S[499980] = 'p';
} else if (seed == 1) {
// issue 1211 hack_sft_2
S = string(499981, 't');
S[124000] = 's';
S[499980] = 'p';
} else {
char c = 'a' + gen.uniform<int>(0, 25);
int N = N_MAX;
S = string(N, c);
int K = gen.uniform<int>(1, 5);
for (int k = 0; k < K; ++k) {
int i = gen.uniform<int>(0, N - 1);
S[i] = 'a' + gen.uniform<int>(0, 25);
}
}
printf("%s\n", S.c_str());
return 0;
}
12 changes: 12 additions & 0 deletions string/suffixarray/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
"all_same_03.out": "0b8c43188e00668c70d592bac4fd278baebc3de6bd588e99646deb641710d195",
"all_same_04.in": "426d60084b919dcf54c8e7232451d2c4ec01612503286cd67c7fa90bd3e674a6",
"all_same_04.out": "f43a20c12a346e012539d68bb9d3b8e084d6d97dfbf80d3f788f48c63975a733",
"almost_single_00.in": "254c23ed86cc2669fe803bf7dc3a05db5776d97ece31c79dc3adb05a1ab076ea",
"almost_single_00.out": "96d1aa8fab4e5a17a771e47e208787f0d0f5e5858f986bacacbc7c31d8053077",
"almost_single_01.in": "96708355a4d016e76c7b5469dc68b108e6fee0bd1a061430613472478bbd8551",
"almost_single_01.out": "21828679cd7ab708b09e1f3b5d0b5de9a65abc268a995ea8ed24ac8e53419b9e",
"almost_single_02.in": "a4e5403d17a9966372a761323d7848d30e3bc928bb91f05949d7925cdc724c69",
"almost_single_02.out": "4543820d064fe324e84c00e17ea0051d53a3937456848bf4e063b3b7e83868e5",
"almost_single_03.in": "5cb67022de87166e3ea564e5bd98e62869cb56f9a086b004d6a8a90f5681fdc8",
"almost_single_03.out": "cda0190457daca5e95a687bd782c204b25895d4b736b61704c1c967971de53c0",
"almost_single_04.in": "2553757d561954eb9867914805cc2d9ead5fbdaf719067962b2f1d9e988ad992",
"almost_single_04.out": "73eb3fa95e3cc2a81e661965dc4a06f4a40180189c4a0509a304928eef017117",
"almost_single_05.in": "20640ffac9077187c09057aa3b7e594d62e175982792d9fbf3648a717db72473",
"almost_single_05.out": "33c3e2c04860711554ee3cad9d785a1d4d490dbbe6ae981eaea0de15289add30",
"binary_carry_00.in": "9c214260f81bf297bde681442c5ff3b851da46704a7606859f7baad8a8a351fc",
"binary_carry_00.out": "4a58fc2478523046f543e796976382a54ad954706ca747671a75c167a4e69d44",
"binary_carry_01.in": "8339f90cd04245a5d89829cffc056a4c87d7678c067a64b4c0841ae84c5c06b4",
Expand Down
3 changes: 3 additions & 0 deletions string/suffixarray/info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/50"
[[tests]]
name = "hack.in"
number = 3
[[tests]]
name = "almost_single.cpp"
number = 6

[params]
N_MAX = 500_000

0 comments on commit e6bef87

Please sign in to comment.