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

HOLES ,GETTING WRONG ANSWER

#include<stdio.h> #include<string.h> int main() { int t,i,J,c; char a[101],n=0; scanf("%d",&t); for(i=0;i<t;i++) { scanf("%s",a); c=strlen(a); J=0; n=0; for(J=0;J<c;J++) {...

View Article


String - Reverse @ same place :-

how to reverse a string without changing its place ? eg - input: welcome to codechef website output: emoclew ot fehcedoc etisbew

View Article


strcmp function

Hello!I was actually trying to compare a single letter of 2 character arrays using the strcmp function. If the letter was the same, it would print "Awesome!" In this case, it should print "Awesome"...

View Article

how the output is coming describe it

include<iostream.h>int main() { int i=0; for(;i++;cout<<i) if(c==5) break; cout<<c; return 0; }

View Article

what's wrong with the following small factorial solution?

include<stdio.h>int main() { int i,j,t,x,fact=1; scanf("%d",&t); for(i=0;i<t;i++) { scanf("%d",&x); for(j=1;j<=x;j++) { fact=fact*j; } printf("%d\n",fact); } return 0; }

View Article


MARBLEGF - Editorial

PROBLEM LINKContestAUTHOR@kurumaTESTER@white_kingSOLUTIONThis is a trivial application of Fenwick tree. Those not familiar with Fenwick tree may look at the topcoder editorial available here.All this...

View Article

horrible spoj !!

Was trying to solve the spoj http://www.spoj.com/problems/HORRIBLE/ .My solution is here http://ideone.com/HEmQXl. but still the WA is coming plzz help guys..:)

View Article

Bytelandian gold coins

getting wrong answer.. my code isinclude<stdio.h>int main() { unsigned long n,p;while((scanf("%lu",&n))!=EOF) { p=0; if(n<12) printf("%lu",n); else { p=(n>>1)+(n/3)+(n>>2);...

View Article


Giving Time limit Exceed in C++ 4.8.1 and AC in C++ 4.3.2

Giving Time limit Exceed in C++ 4.8.1 and AC in C++ 4.3.2 Can anybody just help me and tell why is it so ?? Thanx in advance

View Article


ACM ICPC 1999 Bee Breeding problem

I would like to discuss this problem and understand if there is any efficient way to develop graph using program to solve Bee Breeding problem as mentioned in ACM ICPC 1999 world finals archive ....

View Article

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

Range update and Range Query (BIT)

hey ..did studied http://kartikkukreja.wordpress.com/2013/12/02/range-updates-with-bit-fenwick-tree/ but could not understand "Why we are not doing :- update(a,v) update(b+1,-v) for the update part and...

View Article

Need help in solving high range questions in c++ like:

https://www.hackerrank.com/contests/infinitum-mar14/challenges/summing-the-k-n-series

View Article


C++ File Handling Issue

Hello Guys, I was trying file handling with C++. The problem that I encountered was that when I read from a file using << operator the last string was printed twice. ifstream in("Sample.txt");...

View Article

NZEC run time error

hey i m getting NZEC run time error while submtiing my code on codechef in java though my java code running on my laptop and giving right answer but when submitting on codechef it giving me NZEC error...

View Article


Always getting NZEC Error

This is my code c# code,using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions;namespace Playlist { class Program { static int n,m,cnt=0,key=-1; static...

View Article

views on codechef cook off

yesterday i went through the March cook-off. which had 5 question.i felt the questions is not maintained as it should be.if we look towards the long contest the question toughness level increasing is...

View Article


where the editorial of DIVGAME(Game Of Divisors) cook 44

Codechef Why u not give editorial of DIVGAME( Game Of Divisors ).

View Article

codechef little chef and numbers

#include<stdio.h> int main() { long int T,N,A[100001],j,i,t,p,q; scanf("%ld",&T); while(T--) { scanf("%ld",&N); t=0; for(j=0;j<N;j++) { scanf("%ld",&A[j]); p=A[j]*A[j];...

View Article

How to reduce time limit?

This is a very general question. I have solved the first problem in April Challenge, and got "1.24 seconds" as my time, which puts it in the 52nd page. However, there are 44 pages of people who solved...

View Article
Browsing all 39796 articles
Browse latest View live