Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* [A][M][C][B][N] / [K][R][I][P][6][8] */
- #include <bits/stdc++.h>
- #pragma warning(disable : 4996 4267 4068)
- using namespace std;
- template<typename type>
- using matrix = vector<vector<type>>;
- typedef long long ll;
- const char sp = ' ', nl = '\n';
- const int MOD = 1000000007;
- int main() {
- ios::sync_with_stdio(NULL);
- cin.tie(nullptr), cout.tie(nullptr);
- (void)!freopen("halfsort.in", "r", stdin);
- (void)!freopen("halfsort.out", "w", stdout);
- int n;
- cin >> n;
- vector<int> v(n);
- for (int i = 0; i < n; ++i)
- cin >> v[i];
- sort(v.begin(), v.begin() + n / 2);
- sort(v.begin() + n / 2, v.end(), greater<int>());
- for (int i = 0; i < n; ++i)
- cout << v[i] << sp;
- }
Advertisement
Add Comment
Please, Sign In to add comment