From abf764a938825ea553eb8237f00a718d562b3874 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Thu, 6 Nov 2025 11:34:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=92=8CP1563=E9=97=AE=E9=A2=98=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加test.cpp的打印功能实现 新增P1563.cpp解决算法问题 --- src/11/5/P1563.cpp | 31 +++++++++++++++++++++++++++++++ src/test.cpp | 5 ++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/11/5/P1563.cpp diff --git a/src/11/5/P1563.cpp b/src/11/5/P1563.cpp new file mode 100644 index 0000000..f47fa9b --- /dev/null +++ b/src/11/5/P1563.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include +using ll = int64_t; +#define printf +const ll maxn = 1e5+7; +ll n,m,ans; +struct S{ + int op; + std::string s; +}s[maxn]; + +int main(){ + std::iostream::sync_with_stdio(false); + std::cin.tie(nullptr); + + std::cin>>n>>m; + for(ll i=0;i>s[i].op>>s[i].s; + s[i].op=s[i].op==0?1:-1; + } + for(ll i=1;i<=m;i++){ + ll a,b; + std::cin>>a>>b; + a=a==0?-1:1; + ans=(ans+a*s[(ans%n+n)%n].op*b)%n; + printf("ans=%lld\n",ans); + } + std::cout< +#include +#include int main(){ - + std::println("hello world from {}\n",std::source_location().file_name()); } \ No newline at end of file