Skip to content

Commit 98f5dec

Browse files
committed
[D2] Title: 간단한 369게임, Time: 59 ms, Memory: 50,176 KB -BaekjoonHub
1 parent 19503c3 commit 98f5dec

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

SWEA/D2/1926. 간단한 369게임/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
### 성능 요약
66

7-
메모리: 53,632 KB, 시간: 55 ms, 코드길이: 359 Bytes
7+
메모리: 50,176 KB, 시간: 59 ms, 코드길이: 281 Bytes
88

99
### 제출 일자
1010

11-
2025-05-17 20:16
11+
2025-05-24 13:24
1212

1313

1414

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
T = int(input())
1+
N = int(input())
22
ans = []
3-
for i in range(1, T + 1):
4-
c = str(i)
5-
count_3 = c.count('3')
6-
count_6 = c.count('6')
7-
count_9 = c.count('9')
8-
9-
if count_3 > 0 or count_6 > 0 or count_9 > 0:
10-
# 3, 6, 9가 포함된 경우
11-
result = '-' * (count_3 + count_6 + count_9)
12-
ans.append(result)
13-
else:
14-
ans.append(c)
3+
4+
for i in range(1, N+1):
5+
num = str(i)
6+
7+
cnt_3 = num.count('3')
8+
cnt_6 = num.count('6')
9+
cnt_9 = num.count('9')
10+
11+
if cnt_3 > 0 or cnt_6 > 0 or cnt_9 > 0:
12+
ans.append('-' * (cnt_3 + cnt_6 + cnt_9))
13+
else: ans.append(i)
1514

1615
print(*ans)

0 commit comments

Comments
 (0)