Impressive Queries
CodeChefOpen on judge ↗
You are given two arrays, A and B, both of size N. You are given Q queries of the form (i, j, k). Where for each query, you have to find the cardinality of the multiset S(i,j,k) = {Ap . Bq | i ≤ p,q ≤ j, Ap.Bq ≤ k}. Input First line contains two integers, N, and Q. The next line contains N integers, the array A. The next line contains N integers, the array B. Each of the next Q lines contains
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start