80求调,巨佬勿进。
查看原帖
80求调,巨佬勿进。
1239363
Huoxiangji楼主2024/8/7 19:29

不知道为什么RE,到底哪里错了?```cpp #include<bits/stdc++.h> using namespace std; const int Max=1e5+10; char s[20][Max]; int to[Max],a[Max],sn[Max]; int main(){ int n,m;scanf("%d%d",&n,&m); for(int i=1;i<=n;i++){ scanf("%d %s",&to[i],s[i]); } for(int i=1;i<=m;i++){ scanf("%d %d",&a[i],&sn[i]); } int tot=1; for(int i=1;i<=m;i++){ int way=to[tot]^a[i]; if(way==1){ while(sn[i]--){ tot++; if(tot==n+1)tot=1; } }else{ while(sn[i]--){ tot--; if(tot==0)tot=n; } } } cout<<s[tot]; return 0; }

![]("C:\Users\Administrator\Desktop\图片1.png")
2024/8/7 19:29
加载中...