Number of answers not correct on discuss
Is codechef's system down, or something like that because I answered a question , but on codechef's Discuss Forum , the number of answer's is showing wrong.Here's a snapshotbut in discuss pageI made...
View ArticleSEGSQRSS Solution
Problem : http://www.spoj.com/problems/SEGSQRSS/My Solution : https://ideone.com/eTwPd4Although my solution works on SPOJ, but it fails for the following test case : 1 4 6 1 2 3 4 0 1 4 -5 1 2 4 -2 2 1...
View ArticleInvitation to Gordian Knot — Threads '18 (IIIT Hyderabad)
Gordian Knot is a Project Euler styled contest that challenges you to untangle the intricate enigmas of mathematics. Feel free to deploy your programming skills to make your life easy. Variety of...
View Articlehelp with MLE!
prob : http://codeforces.com/contest/914/problem/Fmy soln : http://codeforces.com/contest/914/submission/34501132I am using suffix tree for every blocks. It takes O(n*28) space atmost but I don't know...
View ArticleZCO13001 - Editorial
PROBLEM SETTER - ZCO 2013DIFFICULTY– Easy PREREQUISITES–SortingFIRST SUBTASK SOLUTION– A simple brute for iterating on all the C(N,2) combinations can do the task easily for N<5000, by taking the...
View ArticleZCO13002 - Editorial
PROBLEM SETTER - ZCO 2013DIFFICULTY– Easy-mediumPREREQUISITES–Dynamic Programming, ImplementationPROBLEM IN SHORT– Given a grid and the reachable coordinates or points, find the maximum value of sum of...
View ArticleZCO13003 - Editorial
PROBLEM SETTER - ZCO 2013DIFFICULTY– EasyPREREQUISITES–Sorting, 2-pointerPROBLEM IN SHORT– Given an array A of N integers and an integer K, find the number of pairs of indices (i,j) and (i $\neq$ j),...
View ArticleZCO13004 - Editorial
PROBLEM SETTER -ZCO 2013PROBLEM LINK -hereDIFFICULTY–MediumPREREQUISITES–Dynamic Programming, MathematicsPROBLEM IN SHORT–Just don’t read the first paragraph. The problem statement can’t be...
View ArticleZCO15002 - Editorial
PROBLEM LINKZCO15002DIFFICULTYEasyPREREQUISITESSimple LogicPROBLEM IN SHORTThe problem statement is simplistic enough.SOLUTIONThe first thing to note is that we have to take the absolute value of the...
View ArticleZCO16001 - Editorial
PROBLEM LINKZCO16001DIFFICULTYEasyPREREQUISITESLogicPROBLEM IN SHORTGiven two arrays, by doing a maximum of k swaps between them, reduce the sum of the maximum element of the two arrays. SOLUTIONThe...
View ArticleZCO16002 - Editorial
PROBLEM LINKZCO16002DIFFICULTYEasyPREREQUISITESDynamic ProgrammingPROBLEM IN SHORTOutput the length of the longest arithmetic sequence possible from the elements of the given arraySOLUTIONThe first...
View ArticleZCO15001 - Editorial
PROBLEM LINKZCO15001DIFFICULTYEasyPREREQUISITESDynamic ProgrammingPROBLEM IN SHORTOutput the smallest n such that the given array can be broken into n contiguous sub-arrays which are...
View ArticleZCO14004 - Editorial
PROBLEM SETTER - ZCO 2014DIFFICULTY– Easy-mediumPREREQUISITES–Dynamic ProgrammingPROBLEM IN SHORT– We have to select some elements from the array, so that the sum of selected elements is as maximum as...
View ArticleZCO14003 - Editorial
PROBLEM SETTER - ZCO 2014DIFFICULTY - EasyPREREQUISITES -SortingKEY OBSERVATIONS - 1. Sorting the array will not affect the answer as the answer doesn't depend on the index of an element. 2. The answer...
View ArticleZCO14002 - Editorial
PROBLEM SETTER - ZCO 2014DIFFICULTY– Easy-mediumPREREQUISITES–Dynamic ProgrammingPROBLEM IN SHORT– We have to select some elements from the array, so that the sum of selected elements is as minimum as...
View ArticleZCO14001 - Editorial
PROBLEM SETTER - ZCO 2014DIFFICULTY - BeginnerPREREQUISITES - ImplementationSOLUTION IN SHORT - There are no techniques or optimizations. Do as directed!!!EXPLANATION - There is a while loop which has...
View ArticleNeed help with a point update and range query question
Given an array of 'N' integers, I need to perform two kinds of queries :Point update : U P : Arr[u] = PGiven a L,R,P I need to find the smallest number in the range [L,R] that is greater than P.There...
View ArticleCPH003A - Editorial
PROBLEM LINKS:ContestAuthor:Faisal RizwanTester:Karan MalhotraDIFFICULTY:CAKEWALKPREREQUISITES:NonePROBLEM:Concatenate two strings such that they form palindrome.EXPLANATION:Just check whether string 1...
View ArticleCPH003D - Editorial
PROBLEM LINKS:ContestAuthor:Dushyant SinghTester:Karan Malhotra and Deepansh ParmaniDIFFICULTY:SimplePREREQUISITES:NonePROBLEM:Find total length covered by all subsets of Power set.EXPLANATION:We can...
View ArticleCPH003B-Editorial
PROBLEM LINK:PracticeAuthor:Karan MalhotraTesterDushyant Singh , Deepansh ParmaniEditorialist:Karan MalhotraDIFFICULTY:EASYPREREQUISITES:Math,BitsPROBLEM:The problem basically asks to print the minimum...
View Article