为什么90,求救(4和17没过)
查看原帖
为什么90,求救(4和17没过)
1404467
Lilindong楼主2024/10/20 11:14
#include<iostream>
using namespace std;
int men[100010],m,n,x,y,t=0;
string na[100010];
int main(){
    cin>>m>>n;
    for(int i=0;i<m;i++)
    cin>>men[i]>>na[i];
    for(int i=0;i<n;i++){
        cin>>x>>y;
        if((men[t]+x)%2==1)
        {
            if(t+y>m)
            t=y+t-m;
            else
            t+=y;
        }
        else
        {
            if(t-y<0)
            t=m+t-y;
            else
            t-=y;
        }
    }
    cout<<na[t];
    return 0;
}
2024/10/20 11:14
加载中...