标签:names += out include ++ scan name str cst
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<map>
using namespace std;
string zh[100005];
int a[100005],s[100005],ch[100005];
int n,m,i,ans=0,t;
using namespace std;
int main()
{
scanf("%d %d",&n,&m);
for(i=0;i<n;i++)//输入情况
cin>>ch[i]>>zh[i];
for(i=1;i<m;i++)//输入指令
{
scanf("%d %d",&a[i],&s[i]);//方向和路程
if(a[i]==0&&ch[i]==0)
ans-=s[i];
else if(a[i]==1&&ch[i]==1)
ans-=s[i];
else
ans+=s[i];
}
if(ans<0)
t=n-(-1*ans%n);
else
t=ans%n;
cout<<zh[t];
return 0;
}
标签:names += out include ++ scan name str cst
原文地址:http://www.cnblogs.com/lsjjz/p/7750109.html