to solve
this problem ? I didn't assume that number will be positive because it was
not given in the problem.
Regards
Mukesh Tiwari
--
If its allowed in Haskell then only one line is enough.
import Data.List
stringWithspace :: String - String
stringWithspace xs = unwords.words $ xs
You can run this program on ideone [ http://ideone.com/RloOE ]
On Aug 12, 8:00 pm, ankit sambyal ankitsamb...@gmail.com wrote:
Guys sorry for
What you explained is the property of Treap data structure . You can
have a look at wiki [ http://en.wikipedia.org/wiki/Treap ] or you can
search google for treap.
On Jun 8, 8:15 pm, Akshata Sharma akshatasharm...@gmail.com wrote:
A rooted binary tree with keys in its nodes has the binary search
Solved . Just changed my count function
count :: Integer - Integer - Integer
count 0 _ = 0
count n p = div n p + count ( div n p ) p
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
Hello all , i am trying to solve this problem
https://www.spoj.pl/problems/SETNJA/
but getting WA. Could some one please tell me what is wrong with
algorithm.
import qualified Data.ByteString.Char8 as BS
import Data.List as L
solve :: BS.ByteString - Integer
solve xs = solverHelp xs 1 where
hello Allysson here is the link for discussion of problem
http://groups.google.co.in/group/comp.programming/browse_thread/thread/4a06904cbbd7c2d3/69c5adbf6badbd8c#69c5adbf6badbd8c
On Oct 22, 5:19 am, Allysson Costa [EMAIL PROTECTED] wrote:
Dear friends,
I have a recurrence to solve but I'm
Hello everybody , i am trying to solve this(http://online-
judge.uva.es/ p/v9/903.html) problem and input constrants are such
that it is not
possible to store the the numbers in the array and print those
numbers. So i use the algorithm
1)get the number and return its coordinate
2) take the
hello everybody .
for a given value i have to find a lowest possible steps in
exponation . i searched on net and i find three ways binary method
[steps will be log2(n)+number of 1 bits in binary expression of n
-1] ,factor method [l(n)=1+l(n-1) if n is prime else n=k*p then
l(n)=l(k)+l(p)] .
factors.
My solution is very ugly but it does solve the problem in a little bit over
60 seconds.
I'm sure there exists more elegant solution for this.
Best,
-Lego
On 6/22/07, mukesh tiwari [EMAIL PROTECTED] wrote:
hello everybody .
i want to know algorithm for finding gaussian
Hi everybody i am trying to solve problem
http://acm.uva.es/p/v105/10512.html.
my solution is
(x+y)y=P(1)
(x-y)x=Q (2)
(1+(y/x))xy=P (1)//taking x outside
(1-(y/x))x^2=Q (2)
dividing 1 and 2 and let (y/x)=k
(1+k)k/(1-k)=P/Q;
solving for k
k=-(P+Q) +-sqrt((P+Q)^2+4PQ)/2Q;
since
Hi everbody , i am trying to solve this problem
http://acm.uva.es/p/v105/10527.html but i am not getting any
efficient algorithm . One algorithm i applied
while(n9)
for i=2 to 9
if(n%i=0)//then i is factor of n and may be a digit in the number
store i for further processing
hello friends i m trying to solve problem
http://online-judge.uva.es/p/v5/523.html
in this problem i using floyd's algorithm i m able to figure out total cost
but i m not able to figure out the path . may be the reason that i did not
understand the algorithm fully and i use it as a black box
hi friends i m trying to solve this problem
http://acm.uva.es/p/v111/11151.html but getting wrong answer..
my algorithm is i m trying to enumarate all the n*(n+1)/2 substrings of
string ,where n is string length...
and checking for palindrom ..
suppose i have input ADAM .then all
hi everybody ..i am stuck on a problem ..i need ur help..
problem is that i have k coins(v1,v2,v3..vk) and money S . and i have to
find out that whether it is possible or not to make the money S using the
given coins...firstly i was using greedy but it failed on some inputs
..like we have 2
hi everybody i m trying to solve this problem but i can't sovle it ...plz
suggest me algorithm to solve it .
link http://students.iitk.ac.in/programmingclub/iopc/problems/
or problem itself is
Two electron are confined in a 1D infinite potential well. Each start from
opposite ends with
Hi Minhaz
thnkx for help and pointing me to my mistake but now one thing i know
... is the number of points in the input will be distinct or there may
be some duplicate point . like suppose the input is like this...
9
0 1
0 2
1 2
1 3
2 3
3 3
3 0
1 0
1 1
now the output of this program will
(0
Hi Minhaz
thnkx for help and pointing me to my mistake but now one thing i know
... is the number of points in the input will be distinct or there may
be some duplicate point . like suppose the input is like this...
9
0 1
0 2
1 2
1 3
2 3
3 3
3 0
1 0
1 1
now the output of this program will
(0
hi Lego Haryanto
i tried ur metoh but still not working ...here is my code and i m
tired with this program . i am not getting even a single method to find
lexicographic shortest path.
#includestdio.h
int min1(int k,int m,int n)
{
int
hi friends i am try to solving this question
http://online-judge.uva.es/p/v1/116.html
for this problem i use left to right dynamic programming so i m getting the
total minimum cost but i m not getting how to find out lexicographically
shortest path .here is my code .if u can change it fine
19 matches
Mail list logo