From 0485bcf5ef88857c3dba4a5cf4d962484da16ae8 Mon Sep 17 00:00:00 2001 From: YoonYn9915 Date: Wed, 11 Jun 2025 18:06:09 +0900 Subject: [PATCH 1/4] =?UTF-8?q?refact:=20=EC=B9=B4=EB=93=9C=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC=ED=95=98=EA=B8=B0=20=ED=8C=8C=EC=9D=BC=20=EC=9C=84?= =?UTF-8?q?=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3\223\234 \354\240\225\353\240\254\355\225\230\352\270\260.py" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "YoonYn9915/2025-06-07-[\353\260\261\354\244\200]-#1715-\354\271\264\353\223\234 \354\240\225\353\240\254\355\225\230\352\270\260.py" => "YoonYn9915/greedy/2025-06-07-[\353\260\261\354\244\200]-#1715-\354\271\264\353\223\234 \354\240\225\353\240\254\355\225\230\352\270\260.py" (100%) diff --git "a/YoonYn9915/2025-06-07-[\353\260\261\354\244\200]-#1715-\354\271\264\353\223\234 \354\240\225\353\240\254\355\225\230\352\270\260.py" "b/YoonYn9915/greedy/2025-06-07-[\353\260\261\354\244\200]-#1715-\354\271\264\353\223\234 \354\240\225\353\240\254\355\225\230\352\270\260.py" similarity index 100% rename from "YoonYn9915/2025-06-07-[\353\260\261\354\244\200]-#1715-\354\271\264\353\223\234 \354\240\225\353\240\254\355\225\230\352\270\260.py" rename to "YoonYn9915/greedy/2025-06-07-[\353\260\261\354\244\200]-#1715-\354\271\264\353\223\234 \354\240\225\353\240\254\355\225\230\352\270\260.py" From d1a58d9019760cfcf712a09ac6f157fde1710725 Mon Sep 17 00:00:00 2001 From: YoonYn9915 Date: Wed, 11 Jun 2025 19:32:10 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[BOJ]=20=EC=88=A8=EB=B0=94=EA=BC=AD?= =?UTF-8?q?=EC=A7=882=20/=20=EA=B3=A8=EB=93=9C=204=20/=2080=EB=B6=84=20?= =?UTF-8?q?=ED=9E=8C=ED=8A=B8=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acmicpc.net/problem/12851 --- ...0\353\260\224\352\274\255\354\247\2102.py" | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 "YoonYn9915/Graph/2025-06-10-[\353\260\261\354\244\200]-#12851-\354\210\250\353\260\224\352\274\255\354\247\2102.py" diff --git "a/YoonYn9915/Graph/2025-06-10-[\353\260\261\354\244\200]-#12851-\354\210\250\353\260\224\352\274\255\354\247\2102.py" "b/YoonYn9915/Graph/2025-06-10-[\353\260\261\354\244\200]-#12851-\354\210\250\353\260\224\352\274\255\354\247\2102.py" new file mode 100644 index 0000000..9476c57 --- /dev/null +++ "b/YoonYn9915/Graph/2025-06-10-[\353\260\261\354\244\200]-#12851-\354\210\250\353\260\224\352\274\255\354\247\2102.py" @@ -0,0 +1,61 @@ + + +import sys +from collections import deque + +inp = sys.stdin.readline + +N, K = map(int, inp().strip().split()) +# 해당 위치로 도달한 최소 시간 저장 +visited = [-1] * (100_000 + 1) +visited[N] = 0 + +# 최소시간에 해당 위치로 도달한 횟수 저장 +ways = [-1] * (100_000 + 1) +ways[N] = 1 + +# (위치, 시간) 형식 +queue = deque() +queue.append((N,0)) + +dx = [-1, 1, 2] + +min_time = -1 + +while queue: + subin_loc,time = queue.popleft() + + # 수빈이가 동생에게 도달한 시간까지만 bfs탐색하고 그 후에 종료 + if min_time != -1 and min_time +2 == time: + break + + # 수빈이가 동생에게 도달한 시간체크 + if min_time == -1 and subin_loc == K: + min_time = visited[subin_loc] + + + # 수빈의 위치에서 3가지 이동 + for i in range(3): + if i == 2: + new_loc = subin_loc * dx[i] + else: + new_loc = subin_loc + dx[i] + + # 새 위치가 범위 안 + if 0 <= new_loc <= 100_000: + # 새로 방문한 위치가 이전에 와보지 못했다면, + if visited[new_loc] == -1: + # 방문 시간 설정해주고 경로 초기화 + visited[new_loc] = visited[subin_loc] + 1 + ways[new_loc] = ways[subin_loc] + queue.append((new_loc, time +1)) + + # 새로 방문한 위치가 이전에 와봤다면, 지금 시간이 이전에 와봤던 시간과 같아야 함. + else: + if visited[new_loc] == visited[subin_loc] + 1: + # 경로 누적시켜줌 + ways[new_loc] = ways[new_loc] + ways[subin_loc] + + +print(visited[K]) +print(ways[K]) \ No newline at end of file From fc9198656503fca947c068f31a30a8f94c59e0a1 Mon Sep 17 00:00:00 2001 From: YoonYn9915 Date: Sat, 14 Jun 2025 23:36:52 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[BOJ]=20=EC=88=A8=EB=B0=94=EA=BC=AD?= =?UTF-8?q?=EC=A7=88=20/=20=EC=8B=A4=EB=B2=84=201=20/=2020=EB=B6=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acmicpc.net/problem/1697 --- ...50\353\260\224\352\274\255\354\247\210.py" | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 "YoonYn9915/Graph/2025-06-14-[\353\260\261\354\244\200]-#1697-\354\210\250\353\260\224\352\274\255\354\247\210.py" diff --git "a/YoonYn9915/Graph/2025-06-14-[\353\260\261\354\244\200]-#1697-\354\210\250\353\260\224\352\274\255\354\247\210.py" "b/YoonYn9915/Graph/2025-06-14-[\353\260\261\354\244\200]-#1697-\354\210\250\353\260\224\352\274\255\354\247\210.py" new file mode 100644 index 0000000..dca746a --- /dev/null +++ "b/YoonYn9915/Graph/2025-06-14-[\353\260\261\354\244\200]-#1697-\354\210\250\353\260\224\352\274\255\354\247\210.py" @@ -0,0 +1,37 @@ +import sys +from collections import deque + +inp = sys.stdin.readline + +N, K = map(int, inp().strip().split()) +# 해당 위치로 도달한 최소 시간 저장 +visited = [-1] * (100_000 + 1) +visited[N] = 0 + +# (위치, 시간) 형식 +queue = deque() +queue.append(N) + +dx = [-1, 1, 2] + +while queue: + loc = queue.popleft() + + # 수빈이가 동생에게 도착했다면 종료 + if loc == K: + print(visited[loc]) + break + + # 수빈의 위치에서 3가지 이동 + for i in range(3): + if i == 2: + new_loc = loc * dx[i] + else: + new_loc = loc + dx[i] + + # 새 위치가 범위 안이고 아직 방문하지 않았다면 + if 0 <= new_loc <= 100_000 and visited[new_loc] == -1: + queue.append(new_loc) + visited[new_loc] = visited[loc] + 1 + + From cb96cd3ff139c5a5821bbc2f6729629b7493e957 Mon Sep 17 00:00:00 2001 From: YoonYn9915 Date: Sat, 14 Jun 2025 23:38:35 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[BOJ]=20=EB=84=88=EC=9D=98=20=ED=8F=89?= =?UTF-8?q?=EC=A0=90=EC=9D=80=20/=20=EC=8B=A4=EB=B2=84=205=20/=2020?= =?UTF-8?q?=EB=B6=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acmicpc.net/problem/25206 --- ...235\230 \355\217\211\354\240\220\354\235\200.py" | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 "YoonYn9915/implementation/2025-06-14-[\353\260\261\354\244\200]-#25206-\353\204\210\354\235\230 \355\217\211\354\240\220\354\235\200.py" diff --git "a/YoonYn9915/implementation/2025-06-14-[\353\260\261\354\244\200]-#25206-\353\204\210\354\235\230 \355\217\211\354\240\220\354\235\200.py" "b/YoonYn9915/implementation/2025-06-14-[\353\260\261\354\244\200]-#25206-\353\204\210\354\235\230 \355\217\211\354\240\220\354\235\200.py" new file mode 100644 index 0000000..cc3ffe0 --- /dev/null +++ "b/YoonYn9915/implementation/2025-06-14-[\353\260\261\354\244\200]-#25206-\353\204\210\354\235\230 \355\217\211\354\240\220\354\235\200.py" @@ -0,0 +1,13 @@ +rating = ['A+', 'A0', 'B+', 'B0', 'C+', 'C0', 'D+', 'D0', 'F'] +grade = [4.5, 4.0, 3.5, 3.0, 2.5, 2.0, 1.5, 1.0, 0] + +total = 0 +result = 0 +for _ in range(20): + s, p, g = input().split() + p = float(p) + if g != 'P': + total += p + result += p * grade[rating.index(g)] + +print('%.6f' % (result / total))