得了95分,不知道那五分怎么被扣掉的,求指导
#include<iostream>#include<string>
using namespace std;
const int maxn=100005;
int n,m,a[maxn],s[maxn];
struct toy{
int x; //1:圈外;
string ch;
}toyy[maxn];
int main()
{
//freopen("toy.in","r",stdin);
//freopen("toy.out","w",stdout);
cin>>n>>m;
for(int i=1;i<=n;i++)
cin>>toyy[i].x>>toyy[i].ch;
for(int i=1;i<=m;i++)
cin>>a[i]>>s[i]; //1:向右;
int now=1;
for(int i=1;i<=m;i++)
{
if(toyy[now].x==1)
{
if(a[i]==1)
{
if(now<s[i])
now=now+n-s[i];
else now=now-s[i];
}
else
{
if(now+s[i]>n)
now=now+s[i]-n;
else now=now+s[i];
}
}
else
{
if(a[i]==0)
{
if(now<s[i])
now=now+n-s[i];
else now=now-s[i];
}
else
{
if(now+s[i]>n)
now=now+s[i]-n;
else now=now+s[i];
}
}
}
cout<<toyy[now].ch;
return 0;
}