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

Variable time limits for programming languages.

How does CodeChef calculate time limits for different programming languages? Is the time limit mentioned on the problem page same for all the languages?

View Article


Few suggestion

In every contest cheating cases keeps on happening. I guess the best solution to this problem is that codechef provide its own IDE like hackerrank so users can test their code on codechef itself.In a...

View Article


My rank is showing NA even after the contest is over.

http://www.codechef.com/users/architsmat38 I am getting my rank as NA even after the June Challenge is over. it says that "we are not able to find country code for you ". I have already registered my...

View Article

galactik.. giving WA. plz help

#include <cstdio> #include<algorithm> #include <cstring> #include <vector> using namespace std; const int maxN = 100010; vector<int> a[maxN]; vector<int> x; int...

View Article

Best known algos for calculating nCr % M

I have often encountered calculating nCr problems the last one being one of the IIIT-M problems but it probably had weak test cases that got easy solutions AC. The other one...

View Article


subset problem

Given n positive real numbers, find whether there exists a triplet among this set such that, the sum of the triplet is in the range (1, 2). Do it in linear time and O (1) space.

View Article

Some More Homework

can someone explain how this solution is formed http://www.codechef.com/viewplaintext/2279326 for http://www.codechef.com/problems/A6 problem

View Article

Help in Sieve of Eratosthenes algorithm

This code is for finding prime with the help of Sieve of Eratosthenes algorithm. I tried to manage memory for the program so instead of declaring large element arry i used calloc function.But when i...

View Article


KSUBSUM - Editorial

PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONGiven an array A of N integers, we are asked to find the Kth maximum sum of a contiguous subarray of elements. Finding the Maximum sum of a subarray...

View Article


I used single digit integers but my code is returning wrong answer for...

#include<stdio.h> void B(int k); int a[171]; int sum,i; int main() { int k,n,o,l,t,j; scanf("%d",&t); for(j=1;j<=t;j++) {scanf("%d",&n); for(i=2;i<=170;i++) a[i]=0; a[0]=0; a[1]=1;...

View Article

Getting WA in problem GARDENSQ

http://www.codechef.com/viewsolution/2376002 .. is generating WA.. i have checked for a few cases and works fine.. but can't figure out why generating wrong answer http://ideone.com/HvHw4Eproblem:...

View Article

Can anyone help me with the question http://www.spoj.com/problems/MORSE/ ??

I was recently studying the tries data structure. I found this question on SPOJ. I also went through this topcoder thread but was unable to understand how DP was used.Also this link mentions that this...

View Article

C++(gcc-4.3.2) VS C++(gcc-4.0.0-8)

I have observed there is significant performance difference between C++(gcc-4.3.2) and C++(gcc-4.0.0-8) Don't know the reason but C++(gcc-4.0.0-8) is significantly slower than C++(gcc-4.3.2). MY one...

View Article


Segmentation Fault

#include<stdio.h> #include<string.h> #include<stdlib.h> int main(){ char *s; char *t, *p; gets(s); gets(t); int k; printf("%s\n",s); k = strlen(s)+strlen(t); p=malloc(k);...

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


explain output

what will be the output of following code:void fun(int x) { if(x>0) { fun(--x); printf("%d ",x); fun(--x); } } int main() { int a=4; fun(a); getch(); return 0; } please explain it too!

View Article

Not getting my rank even after participating in the July Challenge

Why I am not getting my rank even after participating in the July Challenge?? Anyone please help..

View Article


How many consecutive sums a board contains

How can I solve the following: I have a 4x4 board such that every square must be an integer (note that negative integers and zero are allowed). The square has 30 subsquares Ai, and I will denote the...

View Article

CHRECT - Editorial

PROBLEM LINKPracticeContestDIFFICULTYCAKEWALKPREREQUISITESAd HocPROBLEMYou are given a grid of R rows and <b>C columns. The rows are numbered from 1 to R from top to bottom. The columns are...

View Article

KPRIME - Editorial

PROBLEM LINKPracticeContestDIFFICULTYSIMPLEPREREQUISITESSieve of EratosthenesPROBLEMA number is called a K-prime if it has K distinct prime factors.Find the number of K-prime numbers between some given...

View Article
Browsing all 40121 articles
Browse latest View live


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