From 2610f2e7b5f06c24e3e7989871dbc18fa584f31c Mon Sep 17 00:00:00 2001 From: junsungPark <48265129+pknujsp@users.noreply.github.com> Date: Sun, 3 Mar 2024 16:37:53 +0900 Subject: [PATCH] Revert "35-pknujsp" --- ...4 \352\267\270\353\236\230\355\224\204.py" | 43 ------------------- pknujsp/README.md | 5 +-- ...40\353\254\274\355\225\240\354\235\270.py" | 36 ---------------- .../33-\354\262\240\353\241\234.py" | 28 ------------ 4 files changed, 1 insertion(+), 111 deletions(-) delete mode 100644 "pknujsp/BFS/33-\354\235\264\353\266\204 \352\267\270\353\236\230\355\224\204.py" delete mode 100644 "pknujsp/\352\267\270\353\246\254\353\224\224/35-\354\204\240\353\254\274\355\225\240\354\235\270.py" delete mode 100644 "pknujsp/\355\201\220/33-\354\262\240\353\241\234.py" diff --git "a/pknujsp/BFS/33-\354\235\264\353\266\204 \352\267\270\353\236\230\355\224\204.py" "b/pknujsp/BFS/33-\354\235\264\353\266\204 \352\267\270\353\236\230\355\224\204.py" deleted file mode 100644 index 34b5a842..00000000 --- "a/pknujsp/BFS/33-\354\235\264\353\266\204 \352\267\270\353\236\230\355\224\204.py" +++ /dev/null @@ -1,43 +0,0 @@ -from sys import * -from collections import * - - -def bfs(start): - q = deque([start]) - groups[start] = 1 - - while q: - curr = q.popleft() - visited[curr] = True - - for adj in graph[curr]: - if visited[adj]: - continue - - if not groups[adj]: - groups[adj] = -groups[curr] - q.append(adj) - elif groups[adj] == groups[curr]: - return False - return True - - -for _ in range(int(stdin.readline())): - V, E = map(int, stdin.readline().split()) - graph = [[] for i in range(V + 1)] - - for _ in range(E): - a, b = map(int, stdin.readline().split()) - graph[a].append(b) - graph[b].append(a) - - groups = [0] * (V + 1) - visited = [False] * (V + 1) - result = None - - for i in range(1, V + 1): - if groups[i] == 0 and not bfs(i): - result = 'NO' - break - - print('YES' if not result else result) diff --git a/pknujsp/README.md b/pknujsp/README.md index c9fac876..d8568f58 100644 --- a/pknujsp/README.md +++ b/pknujsp/README.md @@ -33,7 +33,4 @@ | 29차시 | 2024.01.18 | DFS, UNION-FIND | [순열 사이클](https://www.acmicpc.net/problem/10451) | [#112](https://github.com/lgoLeadMe/AlgoLeadMe-1/pull/112) | | 30차시 | 2024.01.23 | DP | [ABBC](https://www.acmicpc.net/problem/25381) | [#119](https://github.com/lgoLeadMe/AlgoLeadMe-1/pull/119) | | 31차시 | 2024.01.30 | SORT | [멀티버스 Ⅱ](https://www.acmicpc.net/problem/18869) | [#123](https://github.com/lgoLeadMe/AlgoLeadMe-1/pull/123) | -| 32차시 | 2024.02.04 | BFS | [숨바꼭질 3](https://www.acmicpc.net/problem/13549) | [#127](https://github.com/lgoLeadMe/AlgoLeadMe-1/pull/127) | -| 33차시 | 2024.02.06 | 큐 | [철로](https://www.acmicpc.net/problem/13334) | [#132](https://github.com/lgoLeadMe/AlgoLeadMe-1/pull/132) | -| 34차시 | 2024.02.12 | BFS | [이분 그래프](https://www.acmicpc.net/problem/1707) | [#135](https://github.com/lgoLeadMe/AlgoLeadMe-1/pull/135) | -| 35차시 | 2024.02.18 | 그리디 | [선물할인](https://www.acmicpc.net/problem/25947) | [#137](https://github.com/lgoLeadMe/AlgoLeadMe-1/pull/137) | +| 32차시 | 2024.02.04 | BFS | [숨바꼭질 3](https://www.acmicpc.net/problem/13549) | [#127](https://github.com/lgoLeadMe/AlgoLeadMe-1/pull/127) | \ No newline at end of file diff --git "a/pknujsp/\352\267\270\353\246\254\353\224\224/35-\354\204\240\353\254\274\355\225\240\354\235\270.py" "b/pknujsp/\352\267\270\353\246\254\353\224\224/35-\354\204\240\353\254\274\355\225\240\354\235\270.py" deleted file mode 100644 index 85520b1e..00000000 --- "a/pknujsp/\352\267\270\353\246\254\353\224\224/35-\354\204\240\353\254\274\355\225\240\354\235\270.py" +++ /dev/null @@ -1,36 +0,0 @@ -from sys import * - -n, budget, max_sales = map(int, stdin.readline().split()) -gifts = sorted(list(map(int, stdin.readline().split()))) - -min_price_gift = max_price_gift = 0 -prices = 0 -sales = 0 - -for sale_gift in range(max_sales): - prices += gifts[sale_gift] // 2 - max_price_gift += 1 - - if prices > budget: - print(sale_gift) - exit() - -sales = max_price_gift - min_price_gift -while max_price_gift < n: - if sales < max_sales or max_sales == 0: - if max_sales == 0: - prices += gifts[max_price_gift] - else: - prices += gifts[max_price_gift] // 2 - - if prices > budget: - break - - max_price_gift += 1 - sales += 1 - else: - prices += gifts[min_price_gift] // 2 - min_price_gift += 1 - sales -= 1 - -print(max_price_gift) diff --git "a/pknujsp/\355\201\220/33-\354\262\240\353\241\234.py" "b/pknujsp/\355\201\220/33-\354\262\240\353\241\234.py" deleted file mode 100644 index acf2420a..00000000 --- "a/pknujsp/\355\201\220/33-\354\262\240\353\241\234.py" +++ /dev/null @@ -1,28 +0,0 @@ -from sys import * -from heapq import * - -points = [] - -for _ in range(int(stdin.readline().strip())): - h, o = map(int, stdin.readline().strip().split()) - points.append([min(h, o), max(h, o)]) - -points.sort(key=lambda x: x[1]) -D = int(stdin.readline().strip()) - -max_users = 0 -start_points_list = [] - -for start, destination in points: - if start + D < destination: - continue - heappush(start_points_list, start) - - while start_points_list: - if start_points_list[0] + D >= destination: - break - heappop(start_points_list) - - max_users = max(max_users, len(start_points_list)) - -print(max_users)