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

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


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


RIVPILE - approach

How did u guys solve RIVPILE? I was thinking of having n*m vertices where each vertex i,j represented reaching pile i with disk j. I used dijkstra to find min cost to reach such a vertex. But the...

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

Can anyone point out why am I getting run time error for this program.

all freepascal submissions from the list:-http://www.codechef.com/status/CHEFTEAM,v_akshay

View Article


How use of upper_bound deters time limit exceeded??

I'm solving NOTATRI problem. After figuring out logic and algorithm, I submitted two solutions. One is using upper_bound from algorithm header and other one is doing just same as it. Buter later didn't...

View Article

Image may be NSFW.
Clik here to view.

Introduction to Graphs: Definitions, Traversal, Depth-First Search

Hello @all,As I have mentioned on several posts here on forums, I am only now starting to learn graphs in a more educated, methodical and serious way, so, after I have studied DFS for few days and due...

View Article

How to reduce the memory used in general ?

How to reduce the memory used in general ?

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


wrong ans!!

plz....help me whats wrong in my code ?? which test cases i m missing?? heres the qus http://www.spoj.com/problems/HERDING/ and my sol #include<stdio.h> int ans;int p; int...

View Article

july cook off date

sir the page for july cook off has wrong date written .. it says 23rd july 21:30 (IST) but actually it is 21st July 21:30 (IST) .. so please kindly correct it .. even though the count down timer is...

View Article

Questions like RIVPILE

The question RIVPILE depicted a wonderful application of DIJKSTRA'S ALGORITHM! Can somebody post more questions like RIVPILE?

View Article

How to solve IOPC'12 Question GM Plants?

Looking at the submissions, it has been done by using three segment trees in x, y and z directions. The updates are ok but the query seems unusual. Also, how to obtain the formula r1r2r3 + r1g2g3 +...

View Article


WA for FCTRL2.

#include<stdio.h> void B(int k); int a[200]; 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

TLE with recursion in http://www.codechef.com/problems/CIRCUITS/

I applied binary search with a recursive checking routine,But i keep getting tle with that.But when i applied iterative checking function i got accepted. http://ideone.com/nxo2cn

View Article


Image may be NSFW.
Clik here to view.

CHEFTEAM - Editorial

PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONSETTER'S SOLUTIONCan be found here.TESTER'S SOLUTIONCan be found here.

View Article

Battleship V

http://www.codechef.com/problems/B3 I am stuck with this prob but i can't figure out. Can someone has explanation for this. Thnks

View Article


galactik: wrong code being AC

It is quite strange that the case 5 0,-1,-1,-1,-1,-1 will give 0 while actual answer is -1..i don't think there was any constraint disallowing all negative costs or 0 connections ans still the code is...

View Article

Weak test cases for TKCONVEX.

The test cases for the problem TKCONVEX are very weak. Even though the problem was rejudged during the contest, still I am able to find many solutions which fail very simple test case.8 4 1 2 3 6 6 6 6...

View Article

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
Browsing all 39796 articles
Browse latest View live


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