Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

42-gjsk132 #231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions gjsk132/Implementation/1034 λž¨ν”„.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from collections import defaultdict

input = open(0).readline

n, m = map(int,input().split())

answer = 0

table = defaultdict(int)

for _ in range(n):
row = input().rstrip()
table[row] += 1

turn_on_off_cnt = int(input())

table = list(table.items())
table.sort(key=lambda x: -x[1])

for row, cnt in table:
need_switch_on = m - sum(list(map(int,row)))

if turn_on_off_cnt < need_switch_on:
continue

if (turn_on_off_cnt - need_switch_on)%2==1:
continue

answer = cnt
break

print(answer)
1 change: 1 addition & 0 deletions gjsk132/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@
| 39μ°¨μ‹œ | 2024.05.29 | Dijkstra | [11781 퇴근 μ‹œκ°„](https://www.acmicpc.net/problem/11781) | [🚌](https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/183) |
| 40μ°¨μ‹œ | 2024.06.04 | BitMasking | [[1μ°¨] 비밀지도](https://school.programmers.co.kr/learn/courses/30/lessons/17681) | [πŸ—ΊοΈ](https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/190) |
| 41μ°¨μ‹œ | 2024.07.01 | TSP | [2098 μ™ΈνŒμ› 순회](https://www.acmicpc.net/problem/2098) | [✈️](https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/195) |
| 42μ°¨μ‹œ | 2024.10.08 | Implementation | [1034 λž¨ν”„](https://www.acmicpc.net/problem/1034) | [πŸ’‘](https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/231) |
Loading