题目代码
#include#include #include using namespace std;typedef long long LL;const LL inf=2000000000000;char str[100];int b,s,c,nb,ns,nc,pb,ps,pc;LL r;bool check(LL p){ LL bb=(p*b-nb)*pb,ss=(p*s-ns)*ps,cc=(p*c-nc)*pc; if(bb<0)bb=0; if(ss<0)ss=0; if(cc<0)cc=0; LL cost=bb+ss+cc; if(r>=cost)return true; else return false;}int main(){ b=s=c=0; scanf("%s",&str); for(int i=0;i