Submission #1307814

#TimeUsernameProblemLanguageResultExecution timeMemory
1307814exoworldgdTriple 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(),sq=sqrt(n)+1; ll ans=0; vector<int>pos[n]; for(int i=0;i<n;i++)pos[h[i]].push_back(i); for(int v=1;v<n;v++){ if(v<=sq){ for(int i:pos[v])for(int j:pos[v])if(i<j){ int k=j+v; if(k<n){ 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; } } }else{ for(int i=0;i<n;i++){ int j=i+v,k=i+2*v; if(k<n){ vector<int>a={h[i],h[j],h[k]},b={v,2*v,v}; 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; }

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
      |              ^~~~~~~~~~~~