From 84d0f094d87d31f7d4c3d1d0dd4f95c9ca6e8a7a Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Tue, 8 Oct 2024 19:31:14 +0800 Subject: [PATCH] update --- src/P2822/P2822_prefix.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/P2822/P2822_prefix.cpp diff --git a/src/P2822/P2822_prefix.cpp b/src/P2822/P2822_prefix.cpp new file mode 100644 index 0000000..be7b80a --- /dev/null +++ b/src/P2822/P2822_prefix.cpp @@ -0,0 +1,34 @@ +#include +#include + +using ull = unsigned long long; + +static constexpr size_t max_n {(size_t)2e3+5}; + +ull k, c[max_n][max_n], prefix[max_n][max_n], t, n, m; + +static void init(){ + c[0][0] = c[1][0] = c[1][1] = 1; + for(ull i {2};i>t>>k; + init(); + for(ull i {0};i>n>>m; + m = std::min(m,n); + std::cout<<(prefix[n][m])<<'\n'; + } +} \ No newline at end of file