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 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 ArticleRIVPILE - 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 ArticleCHRECT - 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 ArticleCan 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 ArticleHow 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 ArticleIntroduction 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 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 Articlewrong 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 Articlejuly 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 ArticleQuestions like RIVPILE
The question RIVPILE depicted a wonderful application of DIJKSTRA'S ALGORITHM! Can somebody post more questions like RIVPILE?
View ArticleHow 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 ArticleWA 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 ArticleTLE 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 ArticleCHEFTEAM - Editorial
PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONSETTER'S SOLUTIONCan be found here.TESTER'S SOLUTIONCan be found here.
View ArticleBattleship 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 Articlegalactik: 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 ArticleWeak 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 ArticleC 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