奇数和偶数位是同类,可以分治构造
https://codeforces.com/problemset/problem/641/C
#include <bits/stdc++.h>
#define uset unordered_set
#define umap unordered_map
#define ll long long
#define ii pair<ll, ll>
#define fi first
#define se second
#define vi vector<int>
#define vb vector<bool>
#define vvi vector<vector<int>>
#define vvb vector<vector<bool>>
#define vvl vector<vector<ll>>
#define vl vector<ll>
#define mod 1000000007
#define par "\n"
#define inf 0x3f3f3f3f
#define For(i, n) for (int i = 0; i < n; i++)
#define forn(i, a, b) for(int i=a;i<=b;i++)
#define rep(i, n) for(int i=1;i<=n;i++)
#define pb(a) push_back(a)
#define all(a) a.begin(),a.end()
#define lowbit(x) (x&(-x))
#define fr(x) freopen(x,'r',stdin)
#define fw(x) freopen(x,'w',stdout)
using namespace std;
class A {
public:
int solve() {
int n, q;
cin >> n >> q;
int fir = 0, sec = 1;
while (q--) {
int t;
cin >> t;
if (t == 1) {
int x;
cin >> x;
fir = (fir + x + n) % n;
sec = (sec + x + n) % n;
}
else {
fir = fir ^ 1;
sec = sec ^ 1;
}
}
vi ans(n + 1, 0);
for (int i = 0;i < n;i += 2) {
ans[fir] = i;
fir = (fir + 2) % n;
}
for (int i = 1;i < n;i += 2) {
ans[sec] = i;
sec = (sec + 2) % n;
}
for (int i = 0;i < n;i++) cout << ans[i] + 1 << ' ';
cout << par;
return 0;
}
};
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
A ans;
ans.solve();
return 0;
}