QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#314058#836. Farm of MonstersqwqwfWA 18ms4172kbC++14610b2024-01-25 11:44:372024-01-25 11:44:39

Judging History

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

  • [2024-01-25 11:44:39]
  • 评测
  • 测评结果:WA
  • 用时:18ms
  • 内存:4172kb
  • [2024-01-25 11:44:37]
  • 提交

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;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3628kb

input:

3 1 1
1 1 1

output:

2

result:

ok answer is '2'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

3 1 1
2 2 2

output:

3

result:

ok answer is '3'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

10 34 100
17 27 73 17 60 12 25 53 31 46

output:

5

result:

ok answer is '5'

Test #4:

score: -100
Wrong Answer
time: 18ms
memory: 4172kb

input:

300000 1 1
336470888 634074578 642802746 740396295 773386884 579721198 396628655 503722503 971207868 202647942 2087506 268792718 46761498 443917727 16843338 125908043 691952768 717268783 787375312 150414369 693319712 519096230 45277106 856168102 762263554 674936674 407246545 274667941 279198849 5272...

output:

150098

result:

wrong answer expected '300000', found '150098'