QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#120496 | #3549. 262144 Revisited | pandapythoner# | Compile Error | / | / | C++14 | 1.6kb | 2023-07-06 19:31:38 | 2024-05-31 14:22:08 |
Judging History
你现在查看的是最新测评结果
- [2024-05-31 14:22:08]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2023-07-06 19:31:38]
- 提交
answer
#ifndef LOCAL
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,fma")
#endif
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define flt double
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#ifdef LOCAL
bool local = true;
#else
bool local = false;
#endif
int n;
vector<int> a;
ll solve_slow(){
ll rs = 0;
for(int i = 0; i < n; i += 1){
vector<int> t = {a[i]};
rs += a[i];
for(int j = i + 1; j < n; j += 1){
ll x = a[j];
t.push_back(x);
while(t.size() > 1 && t[t.size() - 2] <= t.back()){
ll f = t.back();
t.pop_back();
if(t.size() > 1 && t[t.size() - 2] < f){
t.pop_back();
t.back() += 1;
t.push_back(f);
} else{
t.pop_back();
t.push_back(f + 1);
}
}
if(t.size() == 1){
rs += t[0];
} else{
rs += t[0] + 1;
}
}
}
return rs;
}
int32_t main(){
if(!local){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
ll t = 1;
if(local){
t = 1e6;
}
while(t--){
cin >> n;
assert(n <= 5000);
a.resize(n);
for(int i = 0; i < n; i += 1){
cin >> a[i];
}
cout << solve_slow() << "\n";
}
return 0;
}
Details
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 answer.code:6: /usr/include/c++/13/bits/allocator.h: In destructor ‘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’ ‘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/queue:63, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:157: /usr/include/c++/13/bits/stl_vector.h:133:14: note: called from here 133 | struct _Vector_impl | ^~~~~~~~~~~~