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

SIGSEGV PCYCLE...can you tell me whats wrong with this code..thanks..

hi, here's the code #include<stdio.h> int main(void) { int n,p,j=1,count=0,i,arr1[1010],arr2[2010]; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&arr1[i]); } for(i=1;i<=n;i++) {...

View Article


HOLES - Editorial

PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATION You just simply need to do what is mentioned in problem statement. Just note that only letter “B” has two holes, and only letters “A”, “D”, “O”,...

View Article


HORSES - Wrong Answer , C

My solution to the problem HORSES is here http://www.codechef.com/viewsolution/3107208But after repeated attempts, I am unable to figure out my mistake leading to the Wrong Answer. Can someone please...

View Article

small factorials ! wrong answer but it is working just the right way in my...

include<stdio.h>include<string.h>include<iomanip>include<iostream>using namespace std; long double fact(int); int main() { int t,n,i=0;long double sol[100]; scanf("%d",&t);...

View Article

Feature request.

Wouldn't it be nice to search for problems using their ID?

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

is there some sort of memory limit in the solutions we submit..is it okay to...

i have this code for TSORT...it works fine on my computer but gives run time error SIGSEGV ..pls have a look at it and tell me whats the bug...thanks...#include<stdio.h> void partition(unsigned...

View Article

KAN13A - Editorial

PROBLEM LINK:PracticeContestAuthor: Dr. Mustaq Ahmed Tester:Jingbo ShangEditorialist:Jingbo ShangDIFFICULTY:Easy - MediumPREREQUISITES:Dynamic ProgrammingPROBLEM:Given a M×N matrix Price (M days, N...

View Article


Help with backtracking

I have had really hard time understanding backtracking algo's.could someone please post some tutorial or some easy questions to begin with bactracking that could explain the concept as well

View Article


WA in SPOJ BYTESM2(Philosophers Stone). Help Please.

problem link: http://www.spoj.com/problems/BYTESM2/my solution: http://ideone.com/xGffsf another solution: http://ideone.com/LFHa8A getting wrong answer can't figure out why. please help.

View Article

KAN13A_HARD_DISK

Please explain OPT[D'][T']= Price[D'][T']+min_(D<D',T'≠T)⁡{OPT[D][T]–Price[D'][T]+100} in detail. Unable to understand representation.

View Article

DEC13 Ranking update taking so long !

Now that all the rejudging is over, why is it taking so much time for the ranking update to happen?

View Article

PREDICT - Editorial

Problem Link:PracticeContestDifficulty:EasyPre-requisites:ProbabilityProblem:In a game between team A and team B, you are given the probability that team A will win. If you bet M rupees on team X, and...

View Article


runtime error when test case is more than 1(chef and codes)

#include<stdio.h> //#include<conio.h> #include<string.h> #include<ctype.h> typedef struct string { char c,map; int occ; }string; string s[26]; void swap(int i,int j); int main()...

View Article

HS08TEST (ATM) Python Runtime (NZEC) Error

I am new to python, and trying my luck on some easy problems first. I have checked my source code for various inputs (problem code HS08TEST, link: http://www.codechef.com/problems/HS08TEST) but unable...

View Article


INTEST : Time Limit Exceeded in C++

I am trying to test my I/O methods via problem: INTEST http://www.codechef.com/problems/INTEST. On submitting it says time-limit exceeded. I previously submitted the similar problem in C, which gets...

View Article

My trailing zeros shell script is getting time limit exceeded , any help on...

#!/bin/bash read no_of_var for ((i=0; i<$no_of_var; i++)) do f1[i]=0 read f while [ "$f" -ge "5" ] do f=$((f/5)) f1[i]=$((f1[i]+f)) done done for ((i=0; i<$no_of_var; i++)) do echo ${f1[i]} done

View Article


Editorial for CUBE CAKES

Can anybody please provide the editorial of CUBE CAKES of December Challenge 2013..???

View Article

Why my code gives me a Runtime error in 4071 problem in Live Archive?

Hello I am stuck in this problem, I have tried many ways to find the error that gives me Runtime Error but I can not find it, I thought my code was O.K but not, any suggestions? The problem is 4071 -...

View Article

Image may be NSFW.
Clik here to view.

A tutorial on Suffix Arrays

Hello @all,This text will focus on the construction of Suffix Arrays, it will aim to explain what they are and what they are used for and hopefully some examples will be provided (it will be mainly...

View Article
Browsing all 39796 articles
Browse latest View live


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