错误
查看原帖
错误
1074541
liuleqi楼主2024/7/26 19:20
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1e7 + 5;
pair <ll, string> q[N];
ll n, m;
//int a[N];
int main() {
	//freopen("P1563_4.in", "r", stdin);
	//freopen("P1563_4.out", "w", stdout);
	cin >> n>> m;
	for (ll i = 1; i <= n; i++) {
		cin >> q[i].first >> q[i].second;
	}
	ll k = 1;
	for (ll i = 1; i <= m; i++) {
		ll a, b;
		cin >> a >> b;
		if (q[k].first == 0) {
			if (a == 0) {
				k = (k + n - b) % n;
			} else {
				k = (k + b) % n;
			}
		} else {
			if (a == 0) {
				k = (k + b) % n;
			} else {
				k = (k + n - b) % n;
			}
		}
	}
	cout << q[k].second;
	return 0;
}

#4, #8 WA,求调

2024/7/26 19:20
加载中...