From d97eb12ac3f7ef99c8130878387b4928448f8dac Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Wed, 9 Oct 2024 00:29:06 +0800 Subject: [PATCH] update --- src/P2822/P2822_debug.cpp | 64 +++++++++++++++++++++++++++++++++++++++ src/test.cpp | 15 +++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/P2822/P2822_debug.cpp create mode 100644 src/test.cpp diff --git a/src/P2822/P2822_debug.cpp b/src/P2822/P2822_debug.cpp new file mode 100644 index 0000000..33709ea --- /dev/null +++ b/src/P2822/P2822_debug.cpp @@ -0,0 +1,64 @@ +#include +#include +#include +#include + +using ull = unsigned long long; + +static const 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 +struct ReadNumber{ + ReadNumber& operator>>(T &num){ + c=0,w=1,n=0; + while(!isdigit(c)){ + if constexpr (!std::is_unsigned_v){ + if(c=='-')w=-1; + } + c=getchar(); + } + while(isdigit(c)){ + n=n*10+(c-'0'); + c=getchar(); + } + num = w*n; + return *this; + } +private: + char c; + T w,n; +}; + +ReadNumber readull; + +int main(){ + readull>>t>>k; + // std::cout<>n>>m; + // std::cout<<"test\n"; + m = std::min(m,n); + std::cout<<(prefix[n][m])<<'\n'; + } +} \ No newline at end of file diff --git a/src/test.cpp b/src/test.cpp new file mode 100644 index 0000000..b052976 --- /dev/null +++ b/src/test.cpp @@ -0,0 +1,15 @@ +#include + +using ull = unsigned long long; + +ull t; + +#define NV(v)#v<<" : "<<(v) + +int main(){ + std::iostream::sync_with_stdio(false), std::cin.tie(nullptr), std::cout.tie(nullptr); + + std::cout<>t; + std::cout<