mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2025-01-11 22:52:00 +00:00
P3391 【模板】文艺平衡树 (80' Code)
R41959184
This commit is contained in:
parent
199b564d3a
commit
7c0dd9bfdf
21
problem/P3391/P3391.cpp
Normal file
21
problem/P3391/P3391.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
vector<int> a;
|
||||
int n, m, l, r;
|
||||
scanf("%d%d", &n, &m);
|
||||
for (int i = 0; i <= n; i++) {
|
||||
a.push_back(i);
|
||||
}
|
||||
for (int i = 0; i < m; i++) {
|
||||
scanf("%d%d", &l, &r);
|
||||
reverse(a.begin() + l, a.begin() + r + 1);
|
||||
}
|
||||
for (int i = 1; i < a.size(); i++) {
|
||||
printf("%d ", a[i]);
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user