Skip to content

Commit

Permalink
Merge pull request #1063 from Tiphereth-A/stirling-number-of-the-seco…
Browse files Browse the repository at this point in the history
…nd-kind-fixed-k

[問題追加] Stirling Number of the Second Kind (Fixed k)
  • Loading branch information
maspypy authored Dec 24, 2023
2 parents f22086d + 95327b4 commit b6b8a15
Show file tree
Hide file tree
Showing 20 changed files with 478 additions and 0 deletions.
62 changes: 62 additions & 0 deletions math/stirling_number_of_the_second_kind_fixed_k/checker.cpp
Original file line number Diff line number Diff line change
@@ -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");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
500000 0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
500000 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
500000 2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6 3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
500000 500000
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
500000 418559
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
500000 113367
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
500000 129432
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
500000 368252
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
500000 927
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
500000 669
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
477655 425604
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
69106 5449
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
372485 264731
30 changes: 30 additions & 0 deletions math/stirling_number_of_the_second_kind_fixed_k/hash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"0_00.in": "5fc37b8e820c7ecfdaf122cdc5a0e1e9174d5d09d0b9c7aae8aeac434ca26aed",
"0_00.out": "4c1bfafa4452b58fb83bfc8ae4acc960764243bded5fed12faca17749b61498f",
"1_00.in": "acebcc8e4f7c5323d64dde3efd17977ee07af2c49ea463badf2119c952677e93",
"1_00.out": "3c28a7788f32691701f5b5bca4845b2a2c3c12944d48d6e98a2cdba652af884b",
"2_00.in": "31d0e1751672810bc8b1676641b7eb72cff5f077bbadd7095b850ab0e52228c8",
"2_00.out": "003954213cb07e9adbfc7d29aa6b10b2633e6557421e35c761486dfc89d6f9a5",
"example_00.in": "bc1c9f8b0ca159e09fd22b8c5efdb431c082e645cd9faa50d04cd20c90f6835a",
"example_00.out": "60b2dd6a86edbc8040b4438e72ba1759acce72bb20a633fe731c3b3fb66b923e",
"max_max_00.in": "31cc7aeb29ddee7d8c3f103ac2c087a256be6d9bb71b987cc8970775911229c8",
"max_max_00.out": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
"max_random_00.in": "fca2f8581bbc5109c9d65d497f244b996adfb945ba357ea1480cb6f90a50791b",
"max_random_00.out": "d39bd5c756e50b2de935dac2098ee31dd08fe4f43f0a58fdd5a6f2a846358292",
"max_random_01.in": "fe4c433b953c83021001b1028ac82fc4e2d6bf5ddedb9777265312aa5c569bac",
"max_random_01.out": "0d7a2dfb97add5c3bef38823c5ac473177edc3f5287c3db7df170051cb930736",
"max_random_02.in": "e84edf8174519a1c26b869799dd3bc6233127547747c229e282c61f3df11dff9",
"max_random_02.out": "df2775a255ef9a85038a2bda9b2f45405ceb773dab5588d1babed7e02f2e40ec",
"max_random_03.in": "1509e23979ce0343ca4c1d7604ac02e45cf8a34e4d687918d58213b55cc645ba",
"max_random_03.out": "fa9cc1cd951858bc1827e7e6e85b90ffd1dc10eb5e28db7b37618e8805f12a4b",
"max_small_00.in": "df79d8e288755ef898e287dd9ef29026c5666726950ce73a66a2162198e6e45a",
"max_small_00.out": "e44e55823ecf8bc4ea92d41d034b2bbec1c3e886c8c0c070ad665537d64beda8",
"max_small_01.in": "868d6bb34e29ba527dc1b4f084bb08be7b20d014ef585f21380b65cd5dda4b98",
"max_small_01.out": "aea66db15772e6afdf12bdcd0615a4f7114a1ec8bebc5da2e9d53502037a104c",
"random_00.in": "1ab898115a59bcc3d57b5bff0318ee262e7e1d51a6bb028d1f3f13e6d6e2dd21",
"random_00.out": "f24ca1a31155c80a34be985ba1bf852cd626fc5986c3fcc8a625a8e6e6481ebf",
"random_01.in": "8bee15d9df180ff0c6816956ec9a7177b1af32e82568dc78479630c767eaeef2",
"random_01.out": "6112f854893710c806a83588bb40d8beeb6897009f1103f0c2be3d2c5478280a",
"random_02.in": "e9029076eec02b5fca42364473327eb7d55b0827ef868c6e1afe0018cf897551",
"random_02.out": "1262007d28c6a446164f7600dd3d3bf0049e0bb0514bcfd7b9750614da474a59"
}
33 changes: 33 additions & 0 deletions math/stirling_number_of_the_second_kind_fixed_k/info.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
title = 'Stirling Number of the Second Kind (Fixed K)'
timelimit = 10.0
forum = "https://github.com/yosupo06/library-checker-problems/issues/961"

[[tests]]
name = "example.in"
number = 1
[[tests]]
name = "0.in"
number = 1
[[tests]]
name = "1.in"
number = 1
[[tests]]
name = "2.in"
number = 1
[[tests]]
name = "max_max.in"
number = 1
[[tests]]
name = "max_random.in"
number = 4
[[tests]]
name = "max_small.in"
number = 2
[[tests]]
name = "random.in"
number = 3

[params]
MOD = 998244353
K_MIN = 0
N_MAX = 500000
Loading

0 comments on commit b6b8a15

Please sign in to comment.