1
35 symbols pyth
Wed Nov 23 18:05:28 2016 Sait2000
sm-K.<^5/hd2/d2*yZ<Z=ZKxL"IVXLCDM"z
2
37 symbols pyth
Fri Oct 28 04:06:19 2016 Sait2000
u+G-K.<^5/hH2/H2*yZ<Z=ZKxL"IVXLCDM"z0
3
40 symbols pyth
Fri Oct 28 03:55:54 2016 Sait2000
VxL"IVXLCDM"z=+Y-K.<^5/hN2/N2*yZ<Z=ZK)sY
4
41 symbols pyth
Fri Oct 28 03:53:29 2016 Sait2000
JZVxL"IVXLCDM"z=+J-K.<^5/hN2/N2*yZ<Z=ZK)J
5
42 symbols pyth
Mon Sep 19 16:50:32 2016 Sait2000
JZVxL"IVXLCDM"z=+J-K.<^5/hN2/N2**2Z<Z=ZK)J
6
44 symbols pyth
Mon Sep 19 16:47:26 2016 Sait2000
JZVxL"IVXLCDM"zK.<^5/hN2/N2=+J-K**2Z>KZ=ZK)J
7
82 symbols perl
Thu Oct 2 17:05:01 2014 vakorol
#!/usr/bin/perl -paF
y/IVXLCDM/0-6/,$x-=2*($s=$l)*($s<($l=10**($_/2)*2.5**($_%2/2)))-$l for@F;$_=$x
8
83 symbols perl
Fri Sep 26 00:35:33 2014 gabrielmad
#!/usr/bin/perl -paF
y/IVXLCDM/0-6/,$x+=2*($s=$l)*($s<($l=10**($_/2)*2.5**($_%2/2)))-$l for@F;$_=-$x
9
84 symbols ruby2.0
Mon Oct 6 14:48:32 2014 fl00r
x=l=0
$<.chars{|a|c='IVXLCDM'=~/#{a}/;c=5**(c%2)*10**(c/2);x+=c;c>l&&x-=l*2;l=c}
p x
10
84 symbols ruby2.0
Wed Aug 17 19:06:57 2016 vitormd
x=l=0
$<.chars{|a|c='IVXLCDM'=~/#{a}/;c=5**(c%2)*10**(c/2);x+=c;c>l&&x-=l*2;l=c}
p x
11
84 symbols ruby
Thu Oct 27 08:17:06 2016 k-mx
x=l=0
$<.chars{|a|c='IVXLCDM'=~/#{a}/;c=5**(c%2)*10**(c/2);x+=c;c>l&&x-=l*2;l=c}
p x
12
85 symbols ruby2.0
Mon Oct 6 14:45:25 2014 fl00r
x=l=0
$<.chars{|a|c='IVXLCDM'.index(a);c=5**(c%2)*10**(c/2);x+=c;c>l&&x-=l*2;l=c}
p x
13
86 symbols perl
Tue Sep 23 16:27:52 2014 vakorol
#!/usr/bin/perl -paF
for(@F){y/IVXLCDM/0-6/;$x+=2*($s=$l)*($s<($l=10**($_/2)*2.5**($_%2/2)))-$l};$_=-$x
14
88 symbols perl
Thu Sep 4 20:57:14 2014 gabrielmad
#!/usr/bin/perl -paF
$x+=($d={M,1000,D,500,C,100,L,50,X,10,V,5,I,1}->{$_})-2*$l*($l<$d),$l=$d for@F;$_=$x
15
89 symbols ruby2.0
Sun Oct 5 18:11:14 2014 fl00r
x=l=0
$<.chars{|a|c='IVXLCDM'.index(a)and(c=5**(c%2)*10**(c/2);x+=c;c>l&&x-=l*2;l=c)}
p x
16
90 symbols perl
Thu Sep 4 20:53:05 2014 gabrielmad
#!/usr/bin/perl -paF
$x+=($d={(M,1000,D,500,C,100,L,50,X,10,V,5,I,1)}->{$_})-2*$l*($l<$d),$l=$d for@F;$_=$x
17
90 symbols python3
Mon Sep 12 17:31:36 2016 Sait2000
x=p=0
for i in map("IVXLCDM".find,input()):n=5**(-~i//2)<<i//2;x+=n-p*2*(n>p);p=n
print(x)
18
91 symbols python2
Thu Sep 4 18:44:42 2014 xsot
x=p=0
for c in raw_input():i="IVXLCDM".find(c);n=5**(-~i/2)<<i/2;x+=n-p*2*(n>p);p=n
print x
19
91 symbols ruby2.0
Sun Oct 5 04:20:42 2014 fl00r
x=l=0
$<.chars{|a|c='IVXLCDM'.index(a)||next;c=5**(c%2)*10**(c/2);x+=c;c>l&&x-=l*2;l=c}
p x
20
91 symbols ruby2.0
Sun Oct 5 04:34:59 2014 fl00r
x=l=0
$<.chars{|a|c='IVXLCDM'.index(a)||next;c=5**(c%2)*10**(c/2);x+=c;c>l&&x-=l*2;l=c}
p x
21
92 symbols perl
Thu Sep 4 05:12:24 2014 gabrielmad
#!/usr/bin/perl -paF
$x+=($d={qw/M 1000 D 500 C 100 L 50 X 10 V 5 I 1/}->{$_})-2*$l*($l<$d),$l=$d for@F;$_=$x
22
92 symbols ruby2.0
Sat Oct 4 21:39:57 2014 fl00r
x=l=0
ARGF.chars{|a|(c='IVXLCDM'.index(a))&&(c=5**(c%2)*10**(c/2);x+=c;c>l&&x-=l*2;l=c)}
p x
23
93 symbols ruby2.0
Sat Oct 4 18:33:58 2014 fl00r
x=l=0
ARGF.chars{|a|c='IVXLCDM'.index(a)||next;c=5**(c%2)*10**(c/2);x+=c;c>l&&x-=l*2;l=c}
p x
24
94 symbols python2
Tue Sep 2 18:16:16 2014 xsot
x=p=0
for c in raw_input():i="IVXLCDM".find(c);n=10**(i/2)*5**(i%2);x+=n-p*2*(n>p);p=n
print x
25
97 symbols ruby2.0
Sat Oct 4 18:22:30 2014 fl00r
x=l=0
ARGF.chars{|a|c='IVXLCDM'.index(a)||next;c=5**(c%2)*10**(c/2);x+=c-l*2*(c>l&&1||0);l=c}
p x
26
99 symbols perl
Tue Sep 16 01:24:35 2014 maxymania
%_=(M,1000,D,500,C,100,L,50,X,10,V,5,I,1);$x+=($d=$_{$_})-2*$l*($l<$d),$l=$d for <>=~m'\S'g;print$x
27
100 symbols python2
Tue Sep 2 18:09:41 2014 xsot
x=p=0
for c in raw_input():n=[1,5,10,50,100,500,1000]["IVXLCDM".index(c)];x+=n-p*2*(n>p);p=n
print x
28
101 symbols perl
Sat Aug 30 04:55:19 2014 gabrielmad
#!/usr/bin/perl -paF
$x+=($d={qw/M 1000 D 500 C 100 L 50 X 10 V 5 I 1/}->{$_})-2*(($l||999)<$d?$l:0),$l=$d for@F;$_=$x
29
102 symbols perl
Sat Aug 30 04:48:46 2014 gabrielmad
#!/usr/bin/perl -p0
$x+=($d={qw/M 1000 D 500 C 100 L 50 X 10 V 5 I 1/}->{$_})-2*(($l||999)<$d?$l:0),$l=$d for/./g;$_=$x
30
130 symbols ruby2.0
Sat Oct 4 17:15:54 2014 fl00r
puts ARGF.read.scan(/((.)\2*)/).map{|a,b|c='IVXLCDM'.index(b);5**(c%2)*10**(c/2)*a.size}.reverse.inject(0){|s,c|c>s ? s+=c : s-=c}
31
148 symbols haskell
Fri Mar 13 12:18:28 2015 YoshikuniJujo
main=interact$show.(\x->x-5^5).r 3125.map((\(Just n)->n).flip lookup(zip"IVXLCDM"[1,5,10,50,100,500,1000]))
r p[]=p
r p(n:s)|p<n=r n s-p|0<1=p+r n s
32
153 symbols ruby2.0
Sat Oct 4 17:10:39 2014 fl00r
R='IVXLCDM'
r=->(a){b=R.index(a);5**(b%2)*10**(b/2)}
puts ARGF.read.scan(/((.)\2*)/).map{|a,b|r.call(b)*a.size}.reverse.inject(0){|s,c|c>s ? s+=c : s-=c}
33
210 symbols python2
Sat Aug 30 02:24:02 2014 PFischbeck
s=raw_input()
a={'M':1000,'D':500,'CM':900,'CD':400,'C':100,'L':50,'XC':90,'XL':40,'X':10,'V':5,'IX':9,'IV':4,'I':1}
i=r=0
while i<len(s):
 for k in sorted(a)[::-1]:
	if s.find(k,i)==i:r+=a[k];i+=len(k)
print r