#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int>v(N+1);
for (int i = 1; i <= N; i++) {
v[i] = i;
}
for (int i = 0; i < M; i++) {
int a, b; cin >> a >> b;
reverse(v.begin()+a,v.end()-N+b);
}
for (int i = 1; i < v.size(); i++) {
cout << v[i] << ' ';
}
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 10816๋ฒ - ์ซ์์นด๋ 2 (0) | 2021.10.24 |
---|---|
[๋ฐฑ์ค,c++] 10815๋ฒ - ์ซ์์นด๋ (0) | 2021.10.24 |
[๋ฐฑ์ค,c++] 10814๋ฒ - ๋์ด์ ์ ๋ ฌ (0) | 2021.10.24 |
[๋ฐฑ์ค,c++] 10809๋ฒ - ์ํ๋ฒณ ์ฐพ๊ธฐ (0) | 2021.10.23 |
[๋ฐฑ์ค,c++] 10808๋ฒ - ์ํ๋ฒณ ๊ฐ์ (0) | 2021.10.23 |
[๋ฐฑ์ค,c++] 10807๋ฒ - ๊ฐ์ ์ธ๊ธฐ (0) | 2021.10.23 |
๋๊ธ