Program not terminating... maybe due to problem in loop....
link text enter code here ``#include<stdio.h>include<stdlib.h>int main() { int t,n,i,a[10000]; long long int c,sum; scanf("%d",&t); while(t--) { sum=0; scanf("%d %lld",&n,&c);...
View Articleambiguous pemutation :wrong answer
as im submitting the code below its showing a wrong answer for this problem here/*created by raghavyadavm*/ include<stdio.h>int main() { int n,i,j,flag=0; unsigned int a[100001],b[100001];do {...
View ArticleHelp regarding WA in SPOJ classical(Bitwise AND)
I have been trying to solve 'Magic bitwise AND' from SPOJ classical problem set: Problem LinkBut I am repeatedly getting wrong answer.I am using the property of 'bitwise and' that 'bitwise and' of a...
View Articlewrong answer in maxcount problem
t=(int)(raw_input()) for i in range(t): n=(int)(raw_input()) a=map(int,raw_input().split()) a.sort() dic={} i=0 for i in range(n): p=a[i] dic[p]=0 for i in range(n): p=a[i] dic[p]=dic[p]+1 max=1 r=a[0]...
View Articleambiguous pemutation :wrong answer
as im submitting the code below its showing a wrong answer/*created by raghavyadavm*/ include<stdio.h>int main() { int n,i,j,flag=0; unsigned int a[100001],b[100001];do { scanf("%d",&n);...
View Articleturbo sort problem
please check the code below and please let me know why it is showing wrong answer on my submission and the code works well on my machinelink for the problem is hereturbosort#include<stdio.h> int...
View Articlehow to solve this prob???
You are given an array of size N . Let's create all the subsets of this array which contain at least 2 elements. Now, operate AND over the elements of each subset, and store the results in a new array....
View ArticleADIGIT wrong answer
I checked all the corner cases but still getting wrong answer...include<stdio.h>int main(){long int n,m,x,i,c1,c2; long long int ans; int j; scanf("%ld %ld",&n,&m); char a[n]; long int...
View ArticleDirecti coding round
Is it possible to get the questions given in the recent Directi coding round (held on 09-02-2014) and possibly solutions any where? [I participated in the round, forgot to note down the qns. Asking...
View ArticlePLEASE HELP
Can we solve this problem in O(n) . http://www.geeksforgeeks.org/minimum-number-of-jumps-to-reach-end-of-a-given-array/
View ArticleHashing and Counting Sort
So Here I am with 2 new Blogs: Enjoy it CS/IT guys! :) http://sanugupta.wordpress.com/2014/06/22/hashing-is-good/http://sanugupta.wordpress.com/2014/06/22/best-example-of-hashing-counting-sort/Hope you...
View ArticleADIGIT-Time limit Exceeded
I am getting time limited exceeded for this question.Can somebody can help me and tell at which point I am doing anything which is not necessary. Only hint will also help me to think my mistake...
View ArticleRESN05 Codechef Campus ReSnackdown
http://www.codechef.com/problems/RESN05in the abv problem i have found the following recurrence:S(n)= number of terms in n = 2*S(n-1)+1 example: S(3)=7 as (1)+(2)+(3)+(1+2)+(2+3)+(3+4)+(1+2+3)F(n)=as...
View ArticleLIFE- Editorial
PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONFirst solution: If we choose an arbitrary assignment for any two adjacent cells of the original state, then the entire rest of the state can be...
View ArticleHow do I speed up java solution to SPOJ HACKRNDM
problem link: http://www.spoj.com/problems/HACKRNDM/ and this is what I have tried: http://ideone.com/65qPOaThe problem has got only 19 successful submissions in java.
View ArticleHelp needed...
Please help me in finding the error in my code. http://www.codechef.com/viewsolution/4046024Thanks!
View ArticleResources on Discrete Mathematics
Since discrete mathematics and competitive programming go hand in hand here are some useful resources available. Skienna (Stony Brook University)Discrete Mathematics (ADUni.org)Add to it if you find...
View Articledelivery bread challenge from practice section
I have solved this challenge and it is running perfectly on online compiling website i.e. ideone But while submitting solution to codechef , it is giving runtime error sigsegv.problem:...
View ArticleCLASSIC MAZE PROBLEM A BIT COMPLICATED
this question can be easily solved using RECURSION.http://www.codechef.com/CODW2012/problems/BPHC03but can anyone please help me in finding the minimum number of steps to reach the (n,n) from (1,1) ? i...
View ArticleCHEFHACK - Editorial
SUGGESTION:Before posting your question with asking for help try this test. The answer should be 436746489. If it is hard to debug this test for you, here is the helpful information. It contains the...
View Article