From 88a1760e0dc321a2ef3181e8f8f56c70ff1cefae Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Sat, 30 Aug 2025 16:59:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(P1896):=20=E4=BF=AE=E5=A4=8D=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E6=9D=A1=E4=BB=B6=E9=94=99=E8=AF=AF=E5=92=8C=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复循环条件中缺少自增运算符的问题 修正变量名错误导致的逻辑问题 移除调试用的注释代码 --- src/8/30/P1896.cpp | 6 ++++-- src/8/30/P1896_pai.cpp | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 src/8/30/P1896_pai.cpp diff --git a/src/8/30/P1896.cpp b/src/8/30/P1896.cpp index 98a4162..c9f9e96 100644 --- a/src/8/30/P1896.cpp +++ b/src/8/30/P1896.cpp @@ -22,6 +22,7 @@ int main(){ std::cin.tie(nullptr); std::cin>>n>>K; + // std::cout<>(line.size(),std::vector(K+1))); - for(ll j=1;jK)continue; dp[1][j][num1]=1; } @@ -62,7 +64,7 @@ int main(){ ){ continue; }else{ - for(ll x=cur1n;x<=K;K++){ + for(ll x=cur1n;x<=K;x++){ dp[i][j][x]+=dp[i-1][k][x-cur1n]; } } diff --git a/src/8/30/P1896_pai.cpp b/src/8/30/P1896_pai.cpp new file mode 100644 index 0000000..5a51047 --- /dev/null +++ b/src/8/30/P1896_pai.cpp @@ -0,0 +1,11 @@ +#include +#include + +std::random_device rd{}; + +std::mt19937 mt{rd()}; + +int main(){ + std::uniform_int_distribution uni1{1,9}, uni2{1,81}; + std::cout<