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

C vs Go in FCTRL

I wrote basically the same code in both Go and C for FCTRL. C took 0.6s and Go took 6.4s!! How is this possible? does codechef do time go run file.go ?

View Article


MOU1H - Editorial

PROBLEM LINKPracticeContestDIFFICULTYMEDIUMPREREQUISITESSuffix Array, LCP ArrayPROBLEMYou are given a sequence of heights. You wish to find the number of unique contiguous subsequences in heights, such...

View Article


getting WA for fire escape routes FIRESC practice(easy)

please tell me... for what test case i am getting WA......http://www.codechef.com/viewsolution/2389557and also my program is taking too much time... explain me another way to optimize my program......

View Article

Sorting strings in C

I was trying to sort c-strings using qsort(). Below is the comp function.> int comp(const void *a,const void *b) > {const char **ia=(const char **)a; > const char **ib=(const char **)b; >...

View Article

Changing bits-Hackerrank

Well I've been trying this question on www.hackerrank.com for the past 3-4 days but am still not getting the perfect score.The problem is that in my code http://ideone.com/kfql6T when I used unsigned...

View Article


Understanding Trie and its applications

Hey folks. I was going through data structures and came across TRIE ( prefix tree ) (I don't know much about it except for the fact that it is used for fast searching of stings and used in auto...

View Article

delay in codechef long rating ??

More than 5 days have passed and still no update. why is it taking so long for rating to come out ???

View Article

PROB - Editorial

PROBLEM LINKPracticeContestDIFFICULTYSIMPLEPREREQUISITESSimple MathPROBLEMYou are given 3 types of tickets.A tickets of type 1, the winning ticket B tickets of type 2, the losing ticket C tickets of...

View Article


Can u help me why this one is giving runtime error but giving the correct...

#include<stdio.h> #include<stdlib.h> int cmpfunc (const void * a, const void * b) { return ( *(int*)a - *(int*)b ); } main() { int N,D; scanf("%d %d",&N,&D); int *L; L =...

View Article


FARASA - Editorial

PROBLEM LINKPracticeContestDIFFICULTYHARDPREREQUISITESFast Fourier TransformPROBLEMYou are given an array of N positive integers. There are N+1C2 sub-arrays of this array. Find the number of unique...

View Article

GALACTIK : getting WA

I am getting WA and I have even considered the case where all planets are connected to each other and the answer is zero for that. please help me. here the the link to my code.http://ideone.com/L5Cenu

View Article

getting WA for GALACTIC.....

hi...i have checked my program for all the boundary conditions........ but still i am getting WA answer...please help me`http://www.codechef.com/viewsolution/2397593 THANKYOU....

View Article

RIVPILE - Editorial

PROBLEM LINKPracticeContestDIFFICULTYMEDIUMPREREQUISITESShortest Path Problem, Dijkstra's AlgorithmPROBLEMYou are given N points in a plane. You are given M types of disks. Each disk has some cost...

View Article


Ratings Updated!

All of you stop discussing check you ranks since it got updated :D

View Article

For those getting WA for GALACTIK.....

check out the following test cases...8 6,1 2,2 3,4 5,5 6,6 7,7 4,1,2,-1,-1,-1,-1,-1,-1 ans=-16 5,1 2,4 5,5 6,6 3,3 1,1,2,3,4,5,6 ans=010 8,1 2,2 3,4 5,5 6,7 8,8 9,3 1,6 2,1,2,3,-1,-1,5,-1,-1,-1,2 ans=-1

View Article


fireescape WA

hey...guys...plzzzzzzzzzzzzzzzzzzzzz..........wht the hell i m gettng wrng ans..........#include<cstdio> #include<iostream> #include<list> #define M 10000007 using namespace std;...

View Article

firescape route WA

lzz......guys help me out....whats wrong in my code eveytime gettting WA...though i have checked for a couple of test cases.#include<cstdio> #include<iostream> #include<list> #define...

View Article


Java String Array output error

import java.util.*; import java.lang.*; class Employees { public void AddStaff() { for(int i=0;i<4;i++) { String s[]={new Scanner(System.in).next()}; } for(int i=0;i<4;i++) {...

View Article

Life, the Universe, and Everything - Run Time Error

So the exercise is: Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop...

View Article

TAAPLUSB - Editorial

Problem Link:PracticeContestDifficulty:EasyPre-requisites:Linearity of Expectation, basic probabilityProblem:Find the expected number of carries when adding two numbers, each at most N digits...

View Article
Browsing all 40121 articles
Browse latest View live


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