Submission #1307806

#TimeUsernameProblemLanguageResultExecution timeMemory
1307806exoworldgdTriple Peaks (IOI25_triples)C++20
Compilation error
0 ms0 KiB
#pragma GCC optimize("Ofast,unroll-loops,inline,fast-math,omit-frame-pointer") #pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt,tune=native,fma") #include <bits/stdc++.h> #define exoworldgd cin.tie(0)->sync_with_stdio(0),cout.tie(0) using namespace std; using ll=long long; ll count_triples(vector<int>h){ int n=h.size(); ll ans=0; for(int i=0;i<n;i++)for(int j=i+1;j<n;j++)for(int k=j+1;k<n;k++){ vector<int>a={h[i],h[j],h[k]},b={j-i,k-i,k-j}; sort(a.begin(),a.end()),sort(b.begin(),b.end()),ans+=a==b; } return ans; } vector<int>construct_range(int m,int k){ vector<int>res; int pat[]={1,2,1,3,2,1,4,3,2,1},sz=10; for(int i=0;i<m;i++)res.push_back(pat[i%sz]); return res; } #ifdef LOCAL signed main(void){ exoworldgd; int type;cin>>type; if(type==1){ int n;cin>>n; vector<int>h(n); for(int i=0;i<n;i++)cin>>h[i]; cout<<count_triples(h)<<'\n'; }else{ int m,k;cin>>m>>k; auto res=construct_range(m,k); cout<<res.size()<<'\n'; for(int x:res)cout<<x<<' '; cout<<'\n'; } } #endif

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 triples.cpp:3:
/usr/include/c++/13/bits/allocator.h: In destructor 'constexpr std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_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 = int]': target specific option mismatch
  184 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/13/vector:66,
                 from /usr/include/c++/13/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53:
/usr/include/c++/13/bits/stl_vector.h:133:14: note: called from here
  133 |       struct _Vector_impl
      |              ^~~~~~~~~~~~