TREEROOT - Editorial
Problem LinkPracticeContestDifficultySIMPLE-EASYPre-requisitesSimple MathProblemYou are given partial information of a binary tree: for each node, its id, and the sum of the ids of its children. This...
View ArticleCode at boundary conditions
I am new to codechef.I am unable to solve problems in even the easy levels.There are always some runtime errors because i cannot allocate an data structure(array) with this much elements and so on.So...
View ArticleComputing Factorials of a huge number in C/C++: A tutorial
Hello @all,As in MARCH13 contest we needed to use primary school arithmetics once again, and as it is a topic that comes up quite frequentely here in the forums thanks to this problem, and also, as I...
View Articlestrstr vs KMP
Could any one please help me understanding which one's better strstr() or KMP for pattern matching.. as recently while doing a question on SPOJ i found that strstr was someway or other faster than...
View ArticleRange Update in BIT
Is it possible to update a range in Binary Indexed Tree...?? I want this to solve the http://www.codechef.com/problems/FLIPCOIN problem using Binary Indexed Tree(BIT).
View ArticleYou are not authorized to access this page
I recently see this error message "You are not authorized to access this page" when I open any problem statement. I wonder is there any problem with my account?
View ArticleHOTEL-practice problem...what is my mistake??
include<iostream>using namespace std;int arrive[1000]; int leave[1000]; int main() {int test,n,max,count; cin>>test; while(test--) { max=0; cin>>n; for(int i=0;i<n;++i) {...
View ArticleATM NZEC C#
using System; class t2 { public static void Main() { double x=double.Parse(Console.ReadLine()); double y=double.Parse(Console.ReadLine()); if (x%5==0) if (x>y) if (y-x<0.5)...
View Articleunable to understand lowest sum logic
I am a newbie to codechef.I am unable to understand logic for lowest sum.I also read the editorial still couldn't get it.Can anybody explain it to me? http://www.codechef.com/problems/LOWSUM
View ArticleProblem Lecandy
Whats the difference between these two codes :(For the problem http://www.codechef.com/problems/LECANDY/,)http://ideone.com/VP6XPQ and http://ideone.com/deupgo
View Articlegetting wrong anwer ambiguous permutations
include<iostream>using namespace std;int main(){ int a[100000]; unsigned long int b; unsigned long int c; unsigned long int x; unsigned long int l=0; while(b!=0){ scanf("%d",b); if(b!=0){ for(int...
View ArticleNewline appearing twice at the end of each line in a file
Here is the code which will help me to print the last three lines of a file:include<iostream>include<conio.h>include<fstream>include<string.h>using namespace std;int main() {...
View Articlemaximum size of an array
can anyone tell me what is the maximum size of different types(bool,int,long long ...etc ) of array (or vector) we can take in c++
View ArticleTutorial for FFT of n inputs where n isn't a power of 2
I want to know how to implement FFT for real inputs not a power of 2.can somebody provide me a tutorial.
View ArticlePREDICT - Editorial
Problem Link:PracticeContestDifficulty:EasyPre-requisites:ProbabilityProblem:In a game between team A and team B, you are given the probability that team A will win. If you bet M rupees on team X, and...
View ArticleMONOPLOY - Editorial
PROBLEM LINK:PracticeContestAuthor:Utkarsh LathTester:Tom ChenEditorialist:Ajay K. VermaDIFFICULTY:Medium PREREQUISITES:Heavy light decomposition, Binary index tree, Segment tree, Caterpillar...
View ArticleCan't figure out the reason for getting a SiGSEGV run time error
I am unable to determine the cause of the error . declaring function prototype as : long long int myfunc(long long int,long long int); A global array has been declared as : long long int a[50000];...
View ArticleWhere can I find problem-set of ACM ICPC Kanpur 2013 ?
Hello, is the problem set used for ACM ICPC kanpur onsite available online for practice anywhere?
View Articlecuckoo search
I know its not related but can any one of you help me with cuckoo search algorithm. i have read about it on wikipedia and i understand it but when it comes to implementation , its blank. I dont...
View ArticleBest known algos for calculating nCr % M
I have often encountered calculating nCr problems the last one being one of the IIIT-M problems but it probably had weak test cases that got easy solutions AC. The other one...
View Article