Codeforces Round #602 DIV1 B1問題 (500pt)
Codeforces Round #602 DIV2 D1問題 (500pt)
Technocup 2020 - Elimination Round 3 D1問題 (500pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N, A[2d5], val[2d5], pl[2d5];
int Q, K[2d5], P[2d5], ind[2d5];
int res[2d5];
{
int k, x = 0;
fenwick<int> f;
rd(N,A(N),Q,(K,P--)(Q));
rep(i,N) val[i] = -A[i], pl[i] = i;
sortA(N, val, pl);
rep(i,Q) ind[i] = i;
sortA(Q, K, P, ind);
f.malloc(N,1);
rep(i,Q){
while(K[i] > x) f.add(pl[x++], 1);
k = f.kth(P[i]);
res[ind[i]] = A[k];
}
wtLn(res(Q));
}
Current time: 2024年04月18日21時54分10秒
Last modified: 2020年02月29日15時42分28秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF602 CF_Div1_B CF_Div2_D
トップページに戻る
Logged in as: unknown user (not login)