CommonLounge is a community of learners who learn together. Get started with the featured resources above, ask questions and discuss related stuff with everyone.
Total numbers having frequency k in a given range
How to find total numbers having frequency=kin a particular range(l,r) in a given array. There are total 10^5 queries of formatl,rand each query is built on the basis of previous query's answer. In particular, after each query we incrementlby the result of the query, swappinglandrifl>r. Note that0<=a[i]<=10^9. Total elements in array isn=10^5.
Hussain has a multiset of integers. In every move Hussain removes a maximum number from this multiset and divides it by 2 (integer division, which is rounded down) , and re-inserts it into the multiset.
Answer Q Queries, i-th query denoted by Q[i]. You must tell the number Hussain will be dividing in the Q[i]-th move (after Q[i]-1 moves in particular).
Constraints: N, Q <= 10^6. Elements of multiset are less than 2^63 (signed long long)
Hey there! I’m Sumeet Varma. I am extremely interested in Algorithms and Data Structures and so I do a lot of competitive programming. I am also a big fan of Counter-Strike, Politics and reading random answers on Quora.
My team (FruitSalad) came 1st in ACM ICPC ‘17 Kharagpur Regionals, 2nd in Kolkata Regionals and 7th in India Finals and we have qualified for World Finals. Also, I have been Red on Codeforces and the highest rated Indian programmer on Codeforces, Hackerrank and Topcoder in the past.
Currently, I am doing an internship at Directi (Bangalore) as a part of my project for final semester at DA-IICT, Gandhinagar.
Ask me anything!
Moderator note: We are very excited to host Sumeet for a Q&A session! He has a max rating of 2515 on Codeforces and 2173 on TopCoder, and you can see the graph going up consistently over the last 2.5 years. It's time to find out more about the person behind ...
Shiv Pratap Singh asked me a bunch of questions about the Facebook internship application. I can't be 100% sure about the application specifics, but 95% certain based on my past experiences.
Shiv: I am in 2nd year in my college and next semester I will be looking for internships. I saw from your linkedin profile you interned at FB. I gave FB Hacker Cup first time and qualified upto 2nd round. Can you help me for that in any way?
Keshav: FB likes people who are active in CP and perform well. Just submit your resume on their website. If you know anyone in FB (same college, etc), contact them and tell them you submitted your resume. But you don't need to do more than that. Just need to submit resume and tell someone inside the company to make sure it gets looked at. If they come to your campus, that would be the better place to do it.
Shiv: So, you also performed in hackercup to get internship? I have 1856 rating on CF just -44 from purple. I think my CP skills are good because CodeNation organized their Internship challeng...
There are N star systems in the space, connected by M wormholes. Each wormhole can teleport you from a system A to system B (you cannot teleport in the opposite direction).
Each wormhole has a fixed time shift T (negative or positive). If it's positive it will take you from system A to system B and you will land T years after. If T is negative, it will take you from A to B and land T years before (in the past).
You are asked to determine the star systems such that for each of them, you can start a journey there and keep traveling in the past (via wormholes) infinitely, so you can watch the Big Bang :)