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]...
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
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 ...
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 execute the code. Space Complexity: It indicates the ...
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...
Computer programmer jobs come under certain shifts, while he or she may work more hours in various types of projects to solve the problem. He or she works for nine to ten hours a day on huge projects to fix the issue. How to become a Computer Programmer? Steps to become a Computer ...
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...
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...
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 : ...