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

Image may be NSFW.
Clik here to view.

SSTORY - Editorial

PROBLEM LINK:PracticeContestAuthor:Bruno OliveiraTester:Mahbubul HasanEditorialist:Jingbo ShangDIFFICULTY:MediumPREREQUISITES:Suffix Array, Suffix Automaton, Binary Search, HashPROBLEM:Find the longest...

View Article


Finding minimum operations

Given a number N (1<= N <= 10^9) Find minimum number of operations to reduce N to 1. The allowed operations being Division by 2Division by 3Subtracting 1All intermediate values of N should also...

View Article


MAXCOUNT - Editorial

PROBLEM LINKSPracticeContestDIFFICULTYEASYEXPLANATIONThis was supposed to be a problem that anyone who knows basic programming could solve and I'm glad that it's satisfied our expectations.For the...

View Article

MIKE3 - Editorial

PROBLEM LINK:PracticeContestAuthor:Constantine SokolTester:Mahbubul HasanEditorialist:Jingbo ShangDIFFICULTY:EasyPREREQUISITES:SearchPROBLEM:Given N objects and M weighted subsets of them, find a...

View Article

ABC-String

Dear all , I am getting WA for the below solution .While local testing , I am getting correct Answer .Any pointer will help me to understand the issue in below implementationThanks rajesh ############...

View Article


TLE using bitmasks.... :(

Why does using a O(2^N * N) approach for this question give TLE.... Solution :- http://www.codechef.com/viewsolution/3652333

View Article

Check if a number is multiple of 9 using bitwise operators

Hi all.In this article (link : http://www.geeksforgeeks.org/divisibility-9-using-bitwise-operators/ ) it is written that (n%8) is equal to (int)(n&7) ( in the function bool isDivBy9(int n) ).Can...

View Article

time difference in two same solution

i submitted my solution for the problem Please like me in jan2014 long challenge. my first solution got time limit exceeded than i created one more solution and in that solution i just added function...

View Article


Shortest Path in a Graph visiting all nodes atleast once!

I have been trying to solve following problem from topcoder practice problems:Problem LinkI have found one of topcoder user's solution, but I could not understand it. Can somebody please explain me the...

View Article


IndiaHacks on HackerEarth

HackerEarth kicks off this summer with India's largest online programming contest - IndiaHacks 2014. We invite all top hackers to a 24 hour programming contest with 7 challenging problems. The...

View Article

Difference between qsort() and sort() ?

I tried solving the question HORSES < http://www.codechef.com/problems/HORSES> , according to my algorithm, I had to sort the array and compare the adjacent entries for minimum difference. My...

View Article

Taking Appropriate number of test cases from input buffer

I am having problem in solving a part of problem. In this problem, we are given an input buffer and we have to take appropriate number of test cases of inputs from it. For example, the input can be 3 4...

View Article

APC 2014 - Interesting powers of two

Can anyone tell how to solve this question from APC 2014 interesting powers of two

View Article


2nd largest element of a max-heap

Hai i have just started learning Data Structures.Please help me...Suppose i have a max heap of arr[1....n].arr[1] stores the maximum element. Is there any way in which i can find the second largest...

View Article

GOC2014 - DMS Mathematica Explain the solution?

The answer seems to be (n*n)/2 - 1 .For N =5 , ans = 11 ;But I think it should be 10; permutation 5 1 4 2 3 4 + 3 + 2 + 1 = 10If I am wrong please explain ?

View Article


Image may be NSFW.
Clik here to view.

A tutorial on Fast Modulo Multiplication (Exponential Squaring)

Hello @all,This tutorial will cover the topic of Fast Modulo Multiplication (also known as Exponential Squaring or Repeated Squaring).This is a very useful technique to have under your arsenal as a...

View Article

MATCHSTICK WA

Hey guys was trying to solve http://www.codechef.com/problems/MSTICK/ by using segment trees but everytime WA comes up ...heres my code http://www.codechef.com/viewsolution/3653425 please help..:(

View Article


programs for integer to roman number.

I want to know what is the roman number of 49 is it XLIX or IL.I participated in computer's fest they gave me program to convert integer to romans .I solved ,but they are saying roman number will be...

View Article

How to create a randomized algorithm function

I am creating a reaction game using a series of lasers and LRDs and need to make a function which waits for a specific pin in portb to be triggered high before it can move onto waiting for the next pin...

View Article

GOC14 Explanation regarding BALL ROOM ?

I didn't quite get what the question was asking.Also the accepted solutions all looked kinda same.Can anyone please explain what the question was asking and how to approach these types of problems?

View Article
Browsing all 39796 articles
Browse latest View live


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