Skip to content

Commit

Permalink
Merge pull request #181 from AlgoLeadMe/13-H0ngJu
Browse files Browse the repository at this point in the history
13-H0ngJu
  • Loading branch information
H0ngJu authored May 10, 2024
2 parents 1eb3ce9 + 7a2b4fe commit 37bdeaf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions H0ngJu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
| 10์ฐจ์‹œ | 2024.04.03 | BFS | [์ˆจ๋ฐ”๊ผญ์งˆ 4](https://www.acmicpc.net/problem/13913) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/177 |
| 11์ฐจ์‹œ | 2024.04.07 | ๊ตฌํ˜„ | [์‚ฌํƒ• ๊ฒŒ์ž„](https://www.acmicpc.net/problem/9095) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/178 |
| 12์ฐจ์‹œ | 2024.04.09 | DFS | [ABCDE](https://www.acmicpc.net/problem/13023) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/180 |
| 13์ฐจ์‹œ | 2024.05.06 | ์™„์ „ํƒ์ƒ‰ | [๋ฆฌ๋ชจ์ปจ](https://www.acmicpc.net/problem/1107) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/181 |

---
22 changes: 22 additions & 0 deletions H0ngJu/์™„์ „ํƒ์ƒ‰/๋ฆฌ๋ชจ์ปจ.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import sys

def input(): return sys.stdin.readline().rstrip()

N = int(input())
M = int(input())
btn = list(map(int, input().rsplit()))

target = abs(N-100)
cnt = target

for i in range(1000001):
check = True
for str_i in str(i):
if int(str_i) in btn:
check = False
break

if check:
cnt = min(cnt, abs(i - N)+len(str(i)))

print(cnt)

0 comments on commit 37bdeaf

Please sign in to comment.