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

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


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


hello sir...!! it is giving me runtime sigsegv error can u plzzz tell me why??

#include<stdio.h> //#include<conio.h> #include<string.h> #include<stdlib.h> const int size=400; char infix[400],postfix[400],stack[400]; int top=-1; int precedence(char ch);...

View Article

How to maintain running time in a program?

I want to know ,how can i know about running time of my program.For good performance ,I have to use an efficient algorithm,,but i want to know ,how can i tell about actual time taken by the...

View Article

how to learn c++

i want to learn C++. what is the best way to proceed?

View Article


runtime error

import java.io.*; class q { public static void main()throws IOException { InputStreamReader isr=new InputStreamReader(System.in); BufferedReader br=new BufferedReader(isr); int arr[]=new int[5];...

View Article

runtime error

#include<stdio.h> #include<conio.h> #include<math.h> void main() { clrscr(); long unsigned int t=0,n1,n,count=0,n3,n4,num,n2; scanf("%lu",&n); n1=n-1; while(n1!=-1) {...

View Article

scanf error!!

Why the value of i an j are being printed ,even before the user is entering the char values?#include<stdio.h> #include<conio.h> int ans; int visited[101][101]={{0}}; char maze[101][101];...

View Article


data structure

please someone suggest me some good data structure books...so that i can implement it efficiently in the contest i want to learn more about hashing ,priorty queues and some useful data structures

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

GALACTIK - Editorial

PROBLEM LINKPracticeContestDIFFICULTYEASYPREREQUISITESDisjoint Set Data Structure, Simple MathPROBLEMThere are N nodes in a graph labeled from 1 to N. Each node has an associated cost with it, given by...

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


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