delete pics to save space
This commit is contained in:
23
1.1563.cpp
Normal file
23
1.1563.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include<cstdio>
|
||||
#include<algorithm>
|
||||
using namespace std;
|
||||
const int maxn=1e5+5;
|
||||
int n,m,pos,a,s;
|
||||
char name[maxn][15];
|
||||
int p[maxn];
|
||||
int main()
|
||||
{
|
||||
#ifdef local
|
||||
freopen("pro.in","r",stdin);
|
||||
#endif
|
||||
scanf("%d%d",&n,&m);
|
||||
for(int i=0;i<n;i++) scanf("%d%s",&p[i],name[i]);
|
||||
for(int i=0;i<m;i++)
|
||||
{
|
||||
scanf("%d%d",&a,&s);
|
||||
if(a^p[pos]) pos=(pos+s)%n;
|
||||
else pos=(pos-s+n)%n;
|
||||
}
|
||||
printf("%s\n",name[pos]);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user