Quantcast
Channel: CodeChef Discuss - latest questions
Browsing all 40121 articles
Browse latest View live
↧

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 Article


MLCHEF - 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 Article


NZEC 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 Article

Little Elephant and Divisors - LEDIV

Problem link : LEDIVMy code : LEDIVCan't figure out the error in my code. Please help.

View Article

Please explain the test cases for CARVANS

Problem link : CARVANS

View Article


Please 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 Article

Gift 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 Article

Image may be NSFW.
Clik here to view.

Introduction 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 Article


what 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 Article


TASTYD - Editorial

Author: Roman Rubanenko Tester: Vamsi Kavala Editorialist: Bruno OliveiraPROBLEM LINKSPracticeContestDIFFICULTYMediumPRE-REQUISITESDivide-and-conquerProblem:Chef is at a restaurant serving dishes....

View Article

HOLES 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 Article

LEEXAMS - 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 Article

COOLGUYS - 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 Article


PALIN: SEGFAULT

Any ideas? http://ideone.com/rozldi

View Article

Nth 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 Article


Image may be NSFW.
Clik here to view.

TWOROADS - 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 Article

Image may be NSFW.
Clik here to view.

TMP01 - 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 Article


Number 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 Article

How 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 Article

Algorithm: 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
Browsing all 40121 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>