Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define ll long long
- #define pii pair<int, int>
- #define pll pair<ll, ll>
- #define pic pair<int, char>
- #define pis pair<int, string>
- #define pcc pair<char, char>
- #define pci pair<char, int>
- #define psi pair<string, int>
- #define pdd pair<double, double>
- #define pli pair<ll, int>
- #define mp make_pair
- #define rangeAll(a) a.begin(), a.end()
- #define RETWR cout << "NO"; return 0;
- const ll MOD = 1000000007;
- const int INF = 1 << 30;
- using namespace std;
- int main() {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin);
- #endif
- multiset<int> ms;
- for (int i = 0; i < 10; ++i) {
- ms.insert(rand());
- }
- int z = 0;
- for (auto it = ms.begin(); it != ms.end(); ) {
- if (z & 1) {
- auto del = it;
- it++;
- ms.erase(del);
- }
- else {
- cout << *it << ' ';
- it++;
- }
- z++;
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement