-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10804.cpp
More file actions
26 lines (25 loc) · 534 Bytes
/
10804.cpp
File metadata and controls
26 lines (25 loc) · 534 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
using namespace std;
int main()
{
cin.tie(nullptr);
cout.tie(nullptr);
ios::sync_with_stdio(false);
int arr[21];
for (int i = 1; i <= 20; i++)
arr[i] = i;
for (int i = 0; i < 10; i++)
{
int a, b;
cin >> a >> b;
for (int i = 0; i <= (b - a) / 2; i++)
{
int t = arr[a + i];
arr[a + i] = arr[b - i];
arr[b - i] = t;
}
}
for (int i = 1; i <= 20; i++)
cout << arr[i] << " ";
return 0;
}