I have been trying to solve the problem https://www.codechef.com/ZCOPRAC/problems/ZCO15001 on codechef, but I m completely failing the logics, i just couldn't make out
problem link :http://www.codechef.com/SMHT2014/problems/SMHTD Thanks!!! I'd try to do a binary search on answer and check correctness in the following way: iterate an array from left to right and if you see some element a_i such that a[i] <= a[i-1], then you assign a[i]...
How to find the number of contiguous subsequences in a given range ? Example : 4 (N) 1 2 3 4 (array[i]) 2 4 (Query) Need to find the number of contiguous subsequences from 2 to 4 whose value is a perfect square. Explanation : { 2 & 3 & 4 } = 0 (Perfect Square) { 3 &...
Now, let's delve into an interesting and crucial topic. The main goal of using DSA is to solve problems effectively and efficiently. How do you assess if your program is efficient? This is where complexities come in, and there are two types: Time Complexity:It measures the time needed to...
Solve questions to male your concepts strong. Do data structure and algorithm. Learn it very sincerely. Practise questions for the same on leetcode, codechef and give contests. Learn one development for an additional edge to your resume. Make projects. If you complete all this then you...
In competitions, participants don't inspect your code; instead, they want you to pass every predetermined test scenario. You shouldn't worry if the competition misses a test case because sometimes for really complicated problems, all the test cases can't be expected. Nevertheless, interview questi...
Link to the problem : https://www.codechef.com/AGPR2020/problems/ALPR2005 Statement : Given a binary sequence of length nn, find the minimum number of changes needed so that bitwise-xor of every subarray of size kk is exactly 1 . 1<=n,k<=100000 . A change operation is defined...
Step 4. In contest During the contest, you can view the problem list and solve problems. Most of Luogu contests do not offer English statements, so it is recommended to use chatGPT to translate it. You can click the "copy Markdown" button in the problem page. ...
starting from12001200all the way upto27002700. Each problem has a step-by-step solution and you can notice how there are no large jumps in logic, but everything comes naturally. I do not claim that this is always possible in each problem, however I solve majority of CF problems in such...
Link to question -- https://www.codechef.com/DEC16/problems/SEAINCR/ Could anybody give me a detailed explanation of how to solve this question from Codechef DEC16 long challenge. Note : I know to find LIS in O(nlogn) but due to the number of queries my solution gets 30 points ...