hiho week 214 register

Ended

Participants:178

Verdict:Accepted
Score:100 / 100
Submitted:2018-08-09 22:10:17

Lang:Python2

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def split_num(x):
    head = x.rstrip('0123456789')
    tail = x[len(head):]
    return headtail
def compare(x,y):
    x1x2 = split_num(x)
    y1y2 = split_num(y)
    return cmp(x1,y1) if not x1 == y1 else cmp(int(x2),int(y2))
N = raw_input()
lis = []
for x in range(int(N)):
    lis.append(raw_input())
lis.sort(compare)
for x in lis:
    print x
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX