6 年前发表5 年前更新题解1 分钟读完 (大约128个字)63次访问「NOIp2016」题解就一道紫题???,还是D1T2\ ??? D1T1 玩具迷题简单的__模拟__,没的说 代码123456789101112131415161718192021222324252627#include <bits/stdc++.h>using namespace std;struct Node{ int towards; string name;} a[100001];int n, m, ai, si;int main() { cin >> n >> m; for (int i = 0; i < n; ++i) { cin >> a[i].towards >> a[i].name; } int peo = 0; for (int i = 1; i <= m; ++i) { cin >> ai >> si; if (ai == 0 && a[peo].towards == 0) peo = (peo + n - si) % n; else if (ai == 0 && a[peo].towards == 1) peo = (peo + si) % n; else if (ai == 1 && a[peo].towards == 0) peo = (peo + si) % n; else if (ai == 1 && a[peo].towards == 1) peo = (peo + n - si) % n; } cout << a[peo].name << endl; return 0;} /* 430ms 4760kB */「NOIp2016」题解https://blog.tonycrane.cc/p/2a6e5fce.html作者TonyCrane发布于2019-05-03更新于2020-05-05许可协议#CppNOIp题解