Please read the new rule regarding the restriction on the use of AI tools. It applies starting from round 972. ×

rishichowdhury711's blog

By rishichowdhury711, history, 5 weeks ago, In English

Hello codeforces , I have a problem which I am unable to solve.The Problem is that you are given an array of length n (1 <= n <= 1e5) . Also you are given q (1 <= q <= 1e5) queries of form (l,r) where (1 <= l <= r <= n) . For each query you have to find the sum of distinct elements in the subarray [l,r].

For example :

if arr[]={1,2,3,4,4} and q=2, and the queries are:

1 3

2 5

so for the above queries the answer would be :

6

9

I am unable to solve this question. Any help regarding this would be helpful .Thank you

Full text and comments »

By rishichowdhury711, history, 2 months ago, In English

Hello Codeforces , I have a question regarding the problem D of the previous contest. I just solved the question using brute force and DSU and it got accepted. I dont understand why it is not giving TLE. It would be really helpful if you can please explain the reason for the code getting accepted or the testcases are weak. Thank you here is the Code

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it