// compile: g++ -o data data.cpp -O3 -std=gnu++20 -Wall -Wextra -Wshadow -D_GLIBCXX_ASSERTIONS -ggdb3 -fmax-errors=2 -DLOCAL
// run: ./data < data.in
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#ifdef LOCAL
#include <debug/codeforces.h>
#define debug(x...) {_variables(#x);_print(x);}
#else
#define debug(x...)
#endif
template<typename...Args> void print_(Args...args){((cout<<args<<" "),...)<<endl;}
#define rep(i,a,b) for(int i=(a);i<(int)(b);++i)
#define sz(v) ((int)(v).size())
#define print(...) print_(__VA_ARGS__);
#define INTINF (int)(9223372036854775807)
#define int long long
#define MAXN 200010
int32_t main() {
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
int n; cin >> n;
vector<int> a(n);
rep(i, 0, n) cin >> a[i];
int pos = n - 1;
while (pos && a[pos-1] < a[pos]) {
--pos;
}
debug(pos)
vector<int> v;
int minv = INTINF;
rep(i, pos, n) minv = min(minv, a[i]);
rep(i, pos - 1, n) if (a[i] != minv) v.push_back(a[i]);
auto cmp = [](int x, int y) {return x > y;};
sort(v.begin(), v.end(), cmp);
rep(i, 0, pos - 1) cout << a[i] << " ";
cout << minv;
rep(i, 0, sz(v)) cout << " " << v[i];
cout << endl;
return 0;
}
Tesoro777 suena prometedor y cumple. Los gráficos son buenos y la experiencia de juego es fluida. Encuentra tu tesoro en tesoro777.
Yo, 12bet bong88! Been using this site for a minute now. Solid selection of games and the payouts are pretty quick. Definitely worth checking out if you’re looking for a reliable online platform. 12bet bong88
vz99bet, huh? Never heard of it. Sounds interesting, though. Thoughts on vz99bet? Gimme your honest reviews!
Thinking of trying my luck with win5bet. Anyone else played there before? Any good tips? Check them out here: win5bet
Thinking bout hitting up win 68 tonight! Anybody else playing? Maybe we can share some strats? Click here to check it out: win 68
Has anyone got a VIP account with winbetvip? I’m curious what the perks are. Worth checking out? Click here to investigate: winbetvip