Correctness of algorithm?
Hi i have following problem You are given two array, first array contain integer which represent heights of persons and second array contain how many persons in front of him are standing who are...
View ArticleHelp on Fast input/output
can someone explain me what's fast input/output. I m sorta new to this stuff and would really appreciate some help. Thank you.
View Articlecan't figure out why its wrong, pls help!
i tried to do this problem : http://www.codechef.com/problems/APGE02and the thing is in my system m getting its answer but on posting my code here on codechef, it says output does not match like...
View ArticleWhat's happening on codechef ?
In today's lunchtime contest , the site got offline for 10-15 minute . I click on poster of november cook-off on home-page , then october challenge pops up . I tried to open the today's lunch question,...
View Articleholes in the text wrong answer
#include <stdio.h> #include <string.h> int main() { int hole=0; int i; char word[100]; scanf("%s",&word); fflush(stdin); i=strlen(word); for(i=0;i<=40;i++) { if(word[i]=='A' ||...
View ArticlePrintf statement getting skipped in Numbers
Hey, this is regarding the problem, NUMBERS which came in the Lunch Time competition. To check my code, I put a few printf statements in my code. But somehow, the printf statement for the strings,...
View ArticleImproving efficiencey of Pairing Program.
I was going through some sample questions on the net. I found a question where you have to count the number of pairs that can be formed according to the info given below:Hobbes has challenged Calvin to...
View ArticlePicking a Group of Tasks while Minimising Time
The ProblemWe are given N number of tasks of N days each. Each takes time t_i to performed. Our job is to find out which combination of tasks minimizes the total amount of time taken. The constraint is...
View ArticleSum of powers
can anyone please tell what will be the properties of a variable c in equation a^x+b^y=c ?????
View ArticleDifferent Answers
I ran the code given below on Ideone and on Xcode (an IDE on mac). Shockingly, they gave me two different answers for the test cases given along with the problem.Ideone shows "Nana". Whereas Xcode...
View ArticleLongest Weird Sequence
I was doing this question. http://www.codechef.com/problems/LWS Finding longest weird subsequence. My approach is to first find LIS and then LDS from the remaining string. I know that this approach is...
View ArticleKnapsack problem
Hey I just learnt the knapsack algo and tried to solve http://www.codechef.com/problems/PPTEST/ but its showing WA. This is my code#include <iostream> using namespace std;int main() {int t;...
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 ArticleMAXCOUNT- Editorial
PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONThis was supposed to be a problem that anyone who knows basic programming could solve and I'm glad that it's satisfied our expectations.For the...
View ArticlePlease explain me what are binary indexed trees and how do they work.
I am not able to understand how to implement binary indexed trees. I cant understand how they work. If someone could please explain me in detail how to use them along with an example.Thank you.
View ArticleSet and Vecotr-Can anyone tell me which is faster?
When we enter the elements in the set it automatically gets sorted. But in a vector it takes another process to sort.Of course that depends on whether you want to sort it or not.But still i want to...
View ArticleDeterminant of a matrix
please can someone tell me how do i write a code for calculating determinant of a matrix in c.That works for all size of matrices eg. 33,44,7*7...and so on....
View Articlehow should i start approaching codechef programming?
i have just started getting involved in codechef.. merely reading the practice questions i am not able to understand the way to approach the programmming. someone please help
View Article