QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#314057#836. Farm of MonstersqwqwfCompile Error//C++14606b2024-01-25 11:44:222024-01-25 11:44:23

Judging History

你现在查看的是最新测评结果

  • [2024-01-25 11:44:23]
  • 评测
  • [2024-01-25 11:44:22]
  • 提交

answer

#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2")
#pragma GCC optimize("Ofast","unroll-loops","inline")
#include<bits/stdc++.h>
#define ll long long
//#define int ll
using namespace std;
const int N=2e5+20,M=1e6+20,mod=998244353;
int a,b,n;
priority_queue<int> q;
signed main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	cin>>n>>a>>b;
	int ans=0,cnt=1;
	for(int i=1,h;i<=n;i++){
		cin>>h;
		int A=((h-1)%b)/a+1,B=(h+b-1)/b;
		ans++,cnt+=B-A-1;q.push(A);
		if(cnt<0){
			int u=q.top();q.pop();
			ans--;cnt+=u+1;
		}
	}
	cout<<ans<<'\n';
	return 0;
}

详细

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:3:
/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
      |              ^~~~~~~~~~~~