#include <iostream>
#include <algorithm>
using namespace std;
int Arr[21];
int main(){
for(int i=1; i<=20; i++){
Arr[i] = i;
}
int a, b;
for(int i=0; i<10; i++){
cin >> a >> b;
reverse(Arr+a, Arr+b+1);
}
for(int i=1; i<21; i++){
cout << Arr[i] << " ";
}
cout << "\n";
return 0;
}
'알고리즘' 카테고리의 다른 글
[알고리즘] 백준 15969 - 행복 (0) | 2024.08.21 |
---|---|
[알고리즘] 백준 2846 - 오르막길 (0) | 2024.08.20 |
[알고리즘] 백준 2146 - 다리 만들기 (0) | 2024.08.18 |
[알고리즘] 백준 18406 - 럭키 스트레이트 (0) | 2024.08.17 |
[알고리즘] 백준 10178 - 할로윈의 사탕 (0) | 2024.08.16 |