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

TLE IN C++ 4.3.2 , AC in 4.8.1

Hello Everybody, I was solving the question Permuted array in Code Niche, IIT bhu . I was getting TLE using an O(n * log n) algorithm in C++ 4.3.2 (even after using fast I/O) and got AC with a O(n^2)...

View Article


why SIGSEGV runtime error?

Could someone please tell me why this is giving me a runtime error (SIGSEGV). I tried to implement my own quicksort rather than the C++ standard sort for the problem, but it ends up giving the runtime...

View Article


accepting single string with space

could anyone tell about accepting a string with space,especially inside a for loop. i have tried getline,gets,but not getting desired output.if i enter the string as: hey sum it is read as 2 inputs...

View Article

Holes:Getting Wa

include<stdio.h>include<string.h>int main() { int i,l,t,cnt=0; char str[100]; scanf("%d",&t); if(t>=1 && t<=40) for(l=1;l<=t;l++) { scanf("%s",str);...

View Article

why output is 0

#include<stdio.h> void fun(void *p); int i; int main() { void *vptr; vptr = &i; fun(vptr); return 0; } void fun(void *p) { int **q; q = (int**)&p; printf("%d\n", **q); } This code...

View Article


number of integer points between two integer points??

given two points which may or may not be collinear, how to calculate the total number of integer point which lies on the line b/w these two points..

View Article

Connected components

http://opencup.ru/files/oce/gp6/problems-e.pdfAny idea what should I do for problem D?

View Article

NFEB5-need suggestion

giveme answer for this testcase ABBABA??

View Article


LFEB14A - Editorial

Problem Link:contest, practiceDifficulty: MediumPre-requisites: Maths, Inversions, Fenwick TreeProblem:We are given two arrays A[] and B[]. At first, we shuffle B[] randomly, then we merge A[] and B[]...

View Article


Getting illegal start of type compilation error

My code for infix to postfix transformation problem is as followspackage CodeChef; import java.util.Scanner; import java.util.Stack; /** * Created by Aniket on 2/23/14. */ public class PostFixConverter...

View Article

Not got rank

Hello, I'm new on codechef and due to my poor English, I can't find the instructions about how to get short contest rating. I participate in February Lunchtime 2014 without regist in exam ( I don't...

View Article

Draughts NZEC

Hi Guys,I am new here and I think like many first timers, I am having the NZEC error on my Java solution. I've been checking to spot any places in my code where it might be causing any run-time errors...

View Article

MPROJ Problem statement

Need Clarity in problem statement as per statement the efficiency is"A Team of Mech guys from UVCE are working on a Robot, which can cut the ripen coconut from the tree by controlling the release of...

View Article


frequent values SPOJ

Was trying to solve http://www.spoj.com/problems/FREQUENT/ and since was unable to figure out so finally looked at the solutions https://github.com/hbdhj/spoj-cpp/blob/master/1684_FREQUENT.cpp There I...

View Article

SEARRAYS - Editorial

Problem Link:contest, practiceDifficulty: EasyPre-requisites: DP, ImplementationProblem:We need to count the number of 01-strings of N chars, such that any continuous section of ones of them have a...

View Article


runtime error in fibonnaci numebr

i am trying to find a fibonnaci number by dp but my code giving runtime error many times. what may be the problem?#include <iostream> #include <cstdio> using namespace std; long long int...

View Article

Valar Morghulis clarification

Please help me with the sample cases of the problem Valar morghulis. http://www.codechef.com/CDNCTR14/problems/GOT I still can't understand how in both cases it's the same person who wins knowing that...

View Article


SEAD - Editorial

Problem Link:contest, practiceDifficulty: MediumPre-requisites: Binary Search, Sparse Tables, Segment TreeProblem:You are given ascending-sorted array A[], consisting of N integers. You are to...

View Article

LMATRIX2-Editorial

PROBLEM LINK:PracticeContestAuthor:Ivan ZdomskyTester:Hiroto Sekido, Gerald AgapovEditorialist:Ajay K. VermaDIFFICULTY:ChallengePREREQUISITES:Chinese Remainder TheoremPROBLEM:We are given a rectangle...

View Article

getting wa rrecipe help

tried many test cases but getting wamy soln: http://www.codechef.com/viewsolution/3469354problem link: http://www.codechef.com/problems/RRECIPE/

View Article
Browsing all 40121 articles
Browse latest View live


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