Submission #1285030

#TimeUsernameProblemLanguageResultExecution timeMemory
1285030okahak71Money (IZhO17_money)C++20
Compilation error
0 ms0 KiB
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include <bits/stdc++.h> #define ll long long #define pb push_back #define ins insert #define pll pair<ll, ll> #define vec vector #define ss second #define ff first using namespace std; const ll inf = 1e17; void _(){ ll n; cin >> n; ll last = 0; vec<ll>a(n + 1, -1); multiset<ll>nw; ll ans = 0; nw.ins(inf); for(ll i = 0; i < n; i++) cin >> a[i]; for(ll i = 1; i <= n; i++){ if(a[i - 1] > a[i]){ while(last < i){ ll up = *nw.upper_bound(a[last]); while(*nw.lower_bound(a[last]) <= up and last < i) nw.ins(a[last++]); ans++; } } } cout << ans << endl; } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); _(); }

Compilation message (stderr)

In file included from /usr/include/c++/13/string:43,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
                 from money.cpp:3:
/usr/include/c++/13/bits/allocator.h: In destructor 'constexpr std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, std::less<long long int>, std::allocator<long long int> >::_Rb_tree_impl<std::less<long long int>, true>::~_Rb_tree_impl()':
/usr/include/c++/13/bits/allocator.h:184:7: error: inlining failed in call to 'always_inline' 'constexpr std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = std::_Rb_tree_node<long long int>]': target specific option mismatch
  184 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/13/map:62,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:152:
/usr/include/c++/13/bits/stl_tree.h:662:16: note: called from here
  662 |         struct _Rb_tree_impl
      |                ^~~~~~~~~~~~~