Skip to content

Commit d86d665

Browse files
committed
시리얼 번호 풀이
1 parent 93b3244 commit d86d665

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

BAEKJOON/2Silver/시리얼 번호.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# https://www.acmicpc.net/problem/1431
3+
4+
"""
5+
5
6+
ABCD
7+
145C
8+
A
9+
A910
10+
Z321
11+
"""
12+
13+
import sys
14+
15+
input = sys.stdin.readline
16+
N = int(input())
17+
lists = []
18+
for _ in range(N):
19+
serial = input().rstrip()
20+
serial_len = len(serial)
21+
serial_sum = 0
22+
for i in serial:
23+
if i.isdigit():
24+
serial_sum += int(i)
25+
26+
lists.append((serial_len, serial_sum, serial))
27+
28+
lists.sort()
29+
print("\n".join(list(map(lambda x: x[2], lists))))

0 commit comments

Comments
 (0)