python3의 내장 정렬 함수는 'stable sort'입니다. 즉, 날먹하기 좋습니다.
This commit is contained in:
8
zeta_python/completed/1431.py
Normal file
8
zeta_python/completed/1431.py
Normal file
@@ -0,0 +1,8 @@
|
||||
N = int(input())
|
||||
|
||||
|
||||
def c(v):
|
||||
return sum([int(i) for i in v if i.isdigit()])
|
||||
|
||||
|
||||
for c in sorted([input() for i in range(N)], key=lambda v: (len(v), c(v), v)):print(c)
|
||||
Reference in New Issue
Block a user