QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#314058 | #836. Farm of Monsters | qwqwf | WA | 18ms | 4172kb | C++14 | 610b | 2024-01-25 11:44:37 | 2024-01-25 11:44:39 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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'