QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#314353#836. Farm of MonstersczcWA 9ms7720kbC++14548b2024-01-25 16:04:002024-01-25 16:04:01

Judging History

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

  • [2024-01-25 16:04:01]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:7720kb
  • [2024-01-25 16:04:00]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;using ll=long long;
int rd(int x=0,char c=getchar()){while(!isdigit(c))c=getchar();while(isdigit(c))x=x*10+(c^48),c=getchar();return x;}
const int N=3e5+5;
int n,x,y,a[N],b[N],c[N];
int main(){
	n=rd(),x=rd(),y=rd();
	for(int i=1,h;i<=n;i++)h=rd(),
	a[i]=ceil(h/1.0/x),b[i]=ceil((h-(h-1)/y*y)/1.0/x),c[i]=ceil(h/1.0/y);
	priority_queue<int> q;int ans=0,w=0;
	for(int i=1;i<=n;i++){
		w+=c[i]-b[i]-1;ans++;q.push(b[i]+1);
		if(w<-1)ans--,w+=q.top(),q.pop();
	}printf("%d",ans);
	return 0;
}

详细

Test #1:

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

input:

3 1 1
1 1 1

output:

2

result:

ok answer is '2'

Test #2:

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

input:

3 1 1
2 2 2

output:

3

result:

ok answer is '3'

Test #3:

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

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: 9ms
memory: 7720kb

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'