Showing posts with label KAMIL. Show all posts
Showing posts with label KAMIL. Show all posts

Wednesday, August 18, 2010

Update Ruby

I went through ruby tutorial due to some reasons and it turned out that using Ruby smaller codes can be written for challenge problems in spoj like KAMIL and SIZECON.

Results :

In problem KAMIL from size of 71 in python i jumped to 43 in Ruby.
Similarly, problem SIZECON reduced from 48 in python to 44 in Ruby.

Sunday, August 15, 2010

KAMIL

This is a challenge task in spoj. Link to the problem KAMIL
The best i could manage is 71 in python. Here's the source code:


for i in range(10):
b=1
for i in raw_input():
if i in'LFTD':b*=2
print b


If anyone has better solution please share :)

PS : Here i am attaching the code with score of 77 because i think that its size can be reduced. If you want the 71 char. code then reply back.