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 ArticleFew 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 ArticleMy 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 Articlegalactik.. 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 ArticleBest 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 Articlesubset 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 ArticleSome 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 ArticleHelp 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 ArticleKSUBSUM - 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 ArticleI 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 ArticleGetting 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 ArticleCan 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 ArticleC++(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 ArticleSegmentation 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 ArticlePROB - 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 Articleexplain 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 ArticleNot 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 ArticleHow 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 ArticleCHRECT - 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 ArticleKPRIME - 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