Codeforces Round #591 DIV1 A問題 (500pt)
Codeforces Round #591 DIV2 C問題 (1500pt)
Technocup 2020 - Elimination Round 1 C問題 (1500pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N, P[2d5], X, A, Y, B;
ll K;
{
ll c, gain;
int i, j, aa, bb, cc, res;
REP(rd_int()){
rd(N,P(N),X,A,Y,B,K);
rep(i,N) P[i] /= 100;
if(X < Y) swap(X,Y), swap(A,B);
c = (ll) A * B / gcd(A,B);
rsortA(N,P);
res = bsearch_min[int,z,0,N+1][
gain = 0;
cc = z / c;
aa = z / A - cc;
bb = z / B - cc;
j = 0;
rep(cc) gain += P[j++] * (X+Y);
rep(aa) gain += P[j++] * X;
rep(bb) gain += P[j++] * Y;
](gain >= K);
wt(if[res==N+1, -1, res]);
}
}
Current time: 2024年04月26日07時34分06秒
Last modified: 2019年10月12日04時11分31秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF591 CF_Div1_A CF_Div2_C
トップページに戻る
Logged in as: unknown user (not login)