Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions codegolf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import sys
l = 'IVXLCDM '
for p in open(sys.argv[1],"r"):
f=''
for i in [6,4,2,0]:
v=int(p)//10**(i//2)%10
f+=l[i]+l[i+v//5+1] if v%5==4 else v//5*l[i+1]+v%5*l[i]
print(f)
9 changes: 9 additions & 0 deletions input.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
243
401
3277
125
1587
2025
3842
429
444
999
2320
9