Skip to content

Commit

Permalink
Merge pull request #1274 from maspypy/bell
Browse files Browse the repository at this point in the history
問題追加 bell number
  • Loading branch information
maspypy authored Nov 11, 2024
2 parents 5a74e3f + d12d092 commit c7b4bbd
Show file tree
Hide file tree
Showing 17 changed files with 564 additions and 0 deletions.
62 changes: 62 additions & 0 deletions enumerative_combinatorics/bell_number/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");
}
}
1 change: 1 addition & 0 deletions enumerative_combinatorics/bell_number/gen/0_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
1 change: 1 addition & 0 deletions enumerative_combinatorics/bell_number/gen/100000_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
100000
1 change: 1 addition & 0 deletions enumerative_combinatorics/bell_number/gen/10000_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10000
1 change: 1 addition & 0 deletions enumerative_combinatorics/bell_number/gen/1000_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1000
1 change: 1 addition & 0 deletions enumerative_combinatorics/bell_number/gen/100_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
100
1 change: 1 addition & 0 deletions enumerative_combinatorics/bell_number/gen/1_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
1 change: 1 addition & 0 deletions enumerative_combinatorics/bell_number/gen/200000_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
200000
1 change: 1 addition & 0 deletions enumerative_combinatorics/bell_number/gen/300000_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
300000
1 change: 1 addition & 0 deletions enumerative_combinatorics/bell_number/gen/400000_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
400000
1 change: 1 addition & 0 deletions enumerative_combinatorics/bell_number/gen/500000_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
500000
1 change: 1 addition & 0 deletions enumerative_combinatorics/bell_number/gen/example_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
24 changes: 24 additions & 0 deletions enumerative_combinatorics/bell_number/hash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"0_00.in": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa",
"0_00.out": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
"100000_00.in": "b80500a01f984c764f1a3b486622d0ef7cc5b13fa9bd57ec9015113eaf875597",
"100000_00.out": "a582bafa3d32de882cedc59823d6ddf9b5d42dface78b85b26aa2d8513dc8e01",
"10000_00.in": "876e13f4e07bb39705302c01f445ffd2d2c3b180a207e4d959d6b671c67da09b",
"10000_00.out": "eb41a96ed5a803b646a8417dac9ff8751b73492e427dd66bef01c6859d0b6cca",
"1000_00.in": "83c02ac2d48c863dab2ccf6870455aadfc2cec073b8db269b517c879d76aa6d9",
"1000_00.out": "4c3e419b64c92381997b110e83f8d8b99aaa184f7e89eea0387713179fd1dbcf",
"100_00.in": "eea8254c7500ba3de996aa8ad6af399183f04e17d4a8102fde539dbc93a90012",
"100_00.out": "98ba9bd802dcc4fb01f7d6f272bff36ddbf7a57d9e69b6c1bdb965d504131b6f",
"1_00.in": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865",
"1_00.out": "3f11ad6bbc7ecca0b2416b713dee77f1a635c00aaeaa946e14cde1c2bfae56d5",
"200000_00.in": "d43574be921c54215a1e05bb2fc0c1a4b63dd2aea4bbfd5b9ebc11a2685943e2",
"200000_00.out": "4799cfd19a0d72492033d0e07aa59f4c4e570fe01766592b2aa322a942270db6",
"300000_00.in": "2d5c043a952d70ef9564858b25a01a30613abfb3d1562f67ef8d089646bbf786",
"300000_00.out": "b0545fe9479fd0297bdd8b648a8e348fe8cbb33b95c4fe916bff98d4bd1f94e8",
"400000_00.in": "1c5af8f01d1a699dafee1845343733af9390097bcaf27a3af56fb060ded9406d",
"400000_00.out": "302e78a91a429d5580700706e20755ed344a863cbb130590b425f7802aa90e52",
"500000_00.in": "eea5daac8b1d1b7b82edaaa7fadadf6b48a439a874efd036fb0666e68c17462e",
"500000_00.out": "7b8bd48239de88d07e78ff59dd5ad73fb78939871a861069c3ef60bc93abddf9",
"example_00.in": "917df3320d778ddbaa5c5c7742bc4046bf803c36ed2b050f30844ed206783469",
"example_00.out": "dee296e4a6cbc8b82afc70533f5d64ca682657a678cd7ea22667bfe77dc7d0be"
}
41 changes: 41 additions & 0 deletions enumerative_combinatorics/bell_number/info.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
title = 'Bell Number'
timelimit = 10.0
forum = "https://github.com/yosupo06/library-checker-problems/issues/716"

[[tests]]
name = "example.in"
number = 1
[[tests]]
name = "0.in"
number = 1
[[tests]]
name = "1.in"
number = 1
[[tests]]
name = "100.in"
number = 1
[[tests]]
name = "1000.in"
number = 1
[[tests]]
name = "10000.in"
number = 1
[[tests]]
name = "100000.in"
number = 1
[[tests]]
name = "200000.in"
number = 1
[[tests]]
name = "300000.in"
number = 1
[[tests]]
name = "400000.in"
number = 1
[[tests]]
name = "500000.in"
number = 1

[params]
MOD = 998244353
N_MAX = 500_000
Loading

0 comments on commit c7b4bbd

Please sign in to comment.