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

Some More Homework - Length of "b" sequence

I'm not the only person who has an issue with this practice problem. Here is a link to the problem.The issue is: b can be an infinite sequence. I have no problem calculating b to an arbitrary length....

View Article


DRANGE_Wrong Ans

I have tried a number of test cases but i still i cant figure out my mistake.Please help.Code link is below : http://www.codechef.com/viewsolution/2403899Also when i was through some of the successful...

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

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

Plz help me with this problem.

Maximum Absurdity this problem was asked in Codeforces Round #193 (Div. 2). Plz anyone tell me what is the approach for solving this problem?

View Article


Sum In a Triangle SIGSEGV Error

Hey guys, I have been trying to solve the sums in a triangle problem. Here's the code:#include<iostream> using namespace std; int a[10][10],j,k; int func(int &n,int &r) { int large[10];...

View Article

An interview of ACRush with Google Code Jam team

ACRush chatting about programming, strategies and more.. here is the link

View Article

References for learning C

Hello, I have a reasonably knowledge regarding java and I would like to learn the C language, it's just curiosity and I want to have a better understanding of the lower level languages (comparing to...

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


RESQ - Editorial

PROBLEM LINKS:PracticeContestDIFFICULTY:SimplePREREQUISITES:Math, Prime FactorizationPROBLEM:The aim is to find two numbers x and y such that x * y = N and |y – x| is as small as...

View Article

NPIN - Editorial

PROBLEM LINKPracticeContestDIFFICULTYHARDPREREQUISITESComputational GeometryPick's TheoremCyrus Beck's Line Clipping AlgorithmSweep Line AlgorithmLine Segment IntersectionPROBLEMYou are given a convex...

View Article

Birthday Candles

I cannot seem to find the problem with my code. Any help will be appreciated. http://ideone.com/XTkzOC

View Article

there is some problem with the solution of COINS question

#include<stdio.h> int main() { int n[20],n1=0,n2=0,n3=0,i,len=0; len=sizeof(n)/sizeof(int); printf("pls enter any %d number:\n",len); for(i=0;i<len;i++) { scanf("%d",&n[i]);...

View Article


Small improvements for code chef

I was thinking of what improvements can be done to code chef without some big effort like a new feature but just some small tweaking . I came up with the following list : 1. Include global time...

View Article

what is the best way to learn hash?

hi how can i learn hash? what is the best link????

View Article


SIGSEGV error in linked-list swapping

Got SIGSEGV error in this function which basically swaps every two numbersvoid swap(struct node *head){ if(head == NULL || head->next == NULL) return; struct node *temp = head,*temp1 =...

View Article

getting wrong answer in SPOJ problem UCV2013J

here is my code/* Valences submitted by Arjun Mishra */ #include<iostream> #include<string.h> #include<math.h> using namespace std; long long int A; long long int compare[21]; void...

View Article


CHRECT - Editorial

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

View Article

How to make a float precise in C++.Help please

Suppose, I declared a float variable p; float p;now ,I want to take input for p; Such as someone typed 12.123123 for p; But when I'm working in program I want to make p only 2 decimal precised............

View Article

The lead game

can i ask whats wrong with my code? i got WA #include<stdio.h> #define max(a,b) (((a) > (b)) ? (a) : (b)) int a[2][10001]; int main() { int t; scanf("%d",&t); for(int x=0;x<t;x++) { int...

View Article
Browsing all 39796 articles
Browse latest View live


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