problem in chef and integer problem
#include<iostream> using namespace std; int counting(long int[],unsigned long int); int main() { unsigned long int n; cin>>n; long int* a=new long int[n]; for(int i=0;i<n;i++)...
View ArticleMLCHEF - Editorial
Problem Link:PracticeContestDifficulty:MediumPre-requisites:Segment Trees, BITProblem:Given a rooted tree, each of whose node is associated with an integer, "health". You have to perform two...
View ArticleNZEC error
Can anyone please tell me why I am getting an NZEC error in this program?? I cant find it! http://www.codechef.com/viewsolution/2686919 ...please!!
View ArticleLittle Elephant and Divisors - LEDIV
Problem link : LEDIVMy code : LEDIVCan't figure out the error in my code. Please help.
View ArticlePlease suggest me an efficient algorithm and easy to understand for this problem
http://www.codechef.com/problems/H1All submissions for this problem are available.Johnny has some difficulty memorizing the small prime numbers. So, his computer science teacher has asked him to play...
View ArticleGift Rift Problem
Hi all !! This is my code for the question gift rift http://www.codechef.com/problems/SAD# ... but everytime when i tried to run it gives me WRONG ANSWER error ... the solution is working fine on my...
View ArticleIntroduction to Graphs: Definitions, Traversal, Depth-First Search
Hello @all,As I have mentioned on several posts here on forums, I am only now starting to learn graphs in a more educated, methodical and serious way, so, after I have studied DFS for few days and due...
View Articlewhat is best deterministic primality checking algorithm??
i hv tried checking primality of a number bt testing till sqrt of number bt its too time consuming for big numbers.. Fermats test involves expotential terms and is tedious to implement for a large...
View ArticleTASTYD - Editorial
Author: Roman Rubanenko Tester: Vamsi Kavala Editorialist: Bruno OliveiraPROBLEM LINKSPracticeContestDIFFICULTYMediumPRE-REQUISITESDivide-and-conquerProblem:Chef is at a restaurant serving dishes....
View ArticleHOLES problem
here is my code for the holes problem..its showing WA..dont know why..import java.util.Scanner; import java.io.*; class HOLES { static InputStreamReader isr=new InputStreamReader(System.in); static...
View ArticleLEEXAMS - Editorial
Problem Link:PracticeContestDifficulty:EasyPre-requisites:High School MathsProblem:Given n tickets, ith ticket can be labelled * Ai with probability Pi percent. * Bi with probability 100-Pi percent....
View ArticleCOOLGUYS - Editorial
Problem Link:PracticeContestDifficulty:EasyPre-requisites:Number theoryProblem:Given an integer N. Two integers A and B are chosen randomly from [1..N]. Find the probability that gcd(A, B) = B as a...
View ArticleNth SHORTEST SUPER SEQUENCE
PLEASE SOMEONE HELP ME INORDER TO SOLVE THISNth Shortest Super SequenceTime out : 4 SecMemory Limit : 64MBA shortest common supersequence of two strings is defined as the shortest possible string...
View ArticleTWOROADS - Editorial
Problem Link:PracticeContestDifficulty:HardPre-requisites:High School GeometryProblem:Given a set S of N points in plane, you have to draw two lines such that sum of squares of distance of each point...
View ArticleTMP01 - Editorial
Problem Link:PracticeContestDifficulty:HardPre-requisites:Suffix-treesProblem:Start with an empty string, and do the following operations: * Append a character to the end of string. * Remove the first...
View ArticleNumber of components in graph
i have been trying to solve this problem lately.. http://www.spoj.com/problems/HERDING/ i am trying to find out the total no. of connected components for the given grid..but i am getting wrong answer...
View ArticleHow to find out for which question you've been upvoted or received a badge?
Whenever I login the codechef account I receive info regarding some badges.But more important is for which question you received the batch.This feature should be implemented if its not there
View ArticleAlgorithm: Given an array, find all the pairs of elements whose sum is k.
algorithm for:-----Given an array, find all the pairs of elements whose sum is k.
View Article