codechef little chef and numbers
#include<stdio.h> int main() { long int T,N,A[100001],j,i,t,p,q; scanf("%ld",&T); while(T--) { scanf("%ld",&N); t=0; for(j=0;j<N;j++) { scanf("%ld",&A[j]); p=A[j]*A[j];...
View Articleconstrints
how to write code for the input constraints of about 10^9 etc.that much size cannot be initialise by array.than how to do it.?
View ArticleREIGN - Editorial
PROBLEM LINK:link:ContestAuthor: @kostya_byTester: @white_kingDIFFICULTY:EasyPROBLEM:This can be solved using dynamic programming. Call best_forward[i] to be the maximum prosperity of a sequence that...
View Articleeditorial for pld
this http://www.spoj.com/problems/PLD/ i am trying to solve it but getting tle plz help me to find palindrome in O(n) time complexty
View ArticleMIKE3 - Editorial
PROBLEM LINK:PracticeContestAuthor:Constantine SokolTester:Mahbubul HasanEditorialist:Jingbo ShangDIFFICULTY:EasyPREREQUISITES:SearchPROBLEM:Given N objects and M weighted subsets of them, find a...
View ArticleSEASORT2 - Editorial
PROBLEM LINK:PracticeContestAuthor:Sergey NaginTester:Mahbubul HasanEditorialist:Jingbo ShangDIFFICULTY:ChallengePREREQUISITES:Heuristic, Greedy, Mixure of Methods, Test Generation PlansPROBLEM:Sort a...
View ArticleExtension for making sure you make private submissions on Ideone
For all those users, who use Ideone for compiling and testing their codes onlineGentle reminder, Ideone has 3 privacy settings:Public: Codes are available to everyone, even shown publicly in recent...
View ArticleSome More Homework - Length of "b" sequence
I'm not the only person who has an issue with this practice problem. Here is a link to the problem.The issue is: b can be an infinite sequence. I have no problem calculating b to an arbitrary length....
View ArticleCHEATING : 7 exactly same solution for MIKE3
Here is a list of 7 exactly same solutions made by different users for the problem MIKE3, asked in...
View ArticleCHGIFT1 - Editorial
Problem Link:PracticeContestAuthorRoman FurkoTesterBalajiganpathiEditorialistUtkarsh LathDifficulty:SimplePre-requisites:Dynamic ProgrammingProblem:Given a list of N integers, each between -9 and 9,...
View ArticleC compiler used by codechef?
I tried to upload a code for the question in practice problems question on binary tournament. In my code in a function I was returning long in place of long long declared in function definition. The...
View ArticlePROSUM - Editorial
PROBLEM LINK:PracticeContestAuthor:Vivek HamirwasiaTester:Mahbubul HasanEditorialist:Jingbo ShangDIFFICULTY:CakewalkPREREQUISITES:Simple MathPROBLEM:Given a sequence of numbers A[1..N], find the number...
View ArticleAlternative to using printf repeatedly
What is the best way to display output quickly? Is it recommended to write all output to one string and then print the string at once? Are there any libraries for quick input/output?
View ArticleA tutorial on Suffix Arrays
Hello @all,This text will focus on the construction of Suffix Arrays, it will aim to explain what they are and what they are used for and hopefully some examples will be provided (it will be mainly...
View ArticleWhat does proper attribution means ?
I was going through some instructions for March Cook-Off 2014 , it is written there " If anyone is using code from some other source in his submission, he should provide proper proper attribution....
View Articlewhat does "pieguy" mean?
I have seen some questions which have the tag "pieguy" .But I can not find the meaning of it in the dictionary.Can anybody tell me what does "pieguy" mean?
View ArticleHow to Check your solution for a Problem from an ended event whose questions...
I was solving questions in an event and I couldn't solve that question on time but I managed to solve after the contest was over, but I couldn't check whether my solution is correct as event ended. we...
View Articlecin/cout abandon forever?
Are there situations when cin/cout turn out to be more useful than scanf/printf? Or is it better to abandon it in all my programs and resort to scanf/printf and other faster input methods instead?
View ArticleSearch and replace
string search (string filename, string word). This function takes a file name and a word and returns a string with the first line where this word exists, preceded by the line number, e.g. if we seach...
View ArticleGERALD07 - Editorial
PROBLEM LINK:PracticeContestAuthor:Gerald AgapovTester:Mahbubul HasanEditorialist:Jingbo ShangDIFFICULTY:Medium-HardPREREQUISITES:Sqrt Decomposition, Link-Cut TreePROBLEM:Given an undirected graph,...
View Article