-
Notifications
You must be signed in to change notification settings - Fork 5
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
14 ljedd2 #170
Open
LJEDD2
wants to merge
13
commits into
main
Choose a base branch
from
14-ljedd2_
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
14 ljedd2 #170
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
97c1258
2024-09-07 ์์ญ์ด ๋งค๋ฌ๊ธฐ.py
LJEDD2 079a6e5
2024-09-07
LJEDD2 0e8b014
2024-09-08 ์์ญ์ด ๋งค๋ฌ๊ธฐ.py
LJEDD2 66752ba
2024-09-11 ์นด๋ ์ ๋ ฌํ๊ธฐ.py
LJEDD2 1c975ac
2024-09-18 N๋ฒ์งธ ํฐ์.py
LJEDD2 3f50541
2024-09-18
LJEDD2 8db95cc
2024-09-21 ์นด๋ ํฉ์ฒด ๋์ด.py
LJEDD2 79029cf
Revert "2024-09-18"
LJEDD2 e76ce00
2024-09-26
LJEDD2 a3c8118
2024-09-21
LJEDD2 5522154
2024-09-25 ์น๊ตฌ.py
LJEDD2 4109c04
2024-09-25
LJEDD2 7cd3ffe
2024-09-28 ์นด๋1.py
LJEDD2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# ๋ ๊ฐ๋จํ ํ์ด ... (๋ฌธ์์ด) | ||
import sys | ||
input = sys.stdin.readline | ||
|
||
for _ in range(int(input())): | ||
cnt = 0 | ||
s = input().rstrip() | ||
while "[]" in s: | ||
s = s.replace("[]", "") | ||
cnt += 1 | ||
|
||
print(2**cnt) | ||
|
||
|
||
|
||
# import sys | ||
|
||
# input = sys.stdin.readline | ||
|
||
# for _ in range(int(input())): | ||
# s = input().rstrip() # ๊ดํธ ๋ฌธ์์ด | ||
|
||
# max_depth = 0 # ์ต๋ ๊น์ด๋ฅผ ์ ์ฅํ ๋ณ์ | ||
# tree = list() # ํ์ฌ ์ด๋ฆฐ ๊ดํธ๋ฅผ ์ ์ฅํ ์คํ์ | ||
|
||
# for i in s: | ||
# # ์ฌ๋ ๊ดํธ์ผ ๊ฒฝ์ฐ ์คํ์ ์ด๋ฆฐ ๊ดํธ ์ถ๊ฐ | ||
# if i == '[': | ||
# tree.append('[') | ||
# continue | ||
# # ๋ซ๋ ๊ดํธ์ผ ๊ฒฝ์ฐ | ||
# max_depth = max(len(tree), max_depth) | ||
# # ํ์ฌ ๊น์ด์ ์ต๋ ๊น์ด ์ค ํฐ ๊ฐ์ ์ ์ฅํ๊ณ | ||
# tree.pop() # ๋ง์ง๋ง ์ด๋ฆฐ ๊ดํธ๋ฅผ ์ ๊ฑฐ | ||
|
||
# print(2 ** max_depth) # ์์ ์ด๋ฃฐ๋ ๊ฐ์ง ์์ฑ, ๊ฐ์ง2-.1๊ฐ์ฉ ๋๋ ๊ฐ์ง | ||
# # ๊ฒฐ๊ตญ์ 2์ depth์น |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import sys, heapq | ||
input = sys.stdin.readline | ||
|
||
n = int(input()) | ||
heap = [] | ||
|
||
for _ in range(n): | ||
for number in map(int, input().split()): | ||
|
||
if len(heap) < n: # ๋น๊ต ๋์์ด ๋ชจ์๋ ๊ฒฝ์ฐ | ||
heapq.heappush(heap, number) #๊ทธ๋๋ก ์ถ๊ฐ | ||
|
||
else: | ||
if number > heap[0]: # ์ ์ผ ์์๊ฒ๋ณด๋ค ํฌ๋ฉด | ||
heapq.heapreplace(heap, number) #์์๊ฑฐ ๋นผ๊ณ ํฐ๊ฑฐ ๋ฃ์ด์ค | ||
|
||
print(heap[0]) # ๋งจ์์ ์๋๊ฒ N๋ฒ์งธ๋ก ํฐ๋ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import sys | ||
import heapq | ||
input = sys.stdin.readline | ||
|
||
cards = list(int(input()) for _ in range(int(input().strip()))) # ๋ฐ์ดํฐ ์ ๋ ฅ๋ฐ์ | ||
heapq.heapify(cards) # ๋ฆฌ์คํธ๋ฅผ ํ๊ตฌ์กฐ๋ก ๋ฐ๊ฟ์ฃผ๋ ํจ์ | ||
|
||
result = 0 | ||
while len(cards) > 1 : | ||
f = heapq.heappop(cards) # ์ฒซ๋ฒ์งธ ๋ญํฑ์ด | ||
s = heapq.heappop(cards) # ๋๋ฒ์งธ ๋ญํฑ์ด | ||
|
||
result += f+s | ||
|
||
# ๋ฐ๊ฟ์น๊ธฐ ํ์๊ฐ ์ต์๊ฐ ๋๊ฒ๋ | ||
heapq.heappush(cards, f+s) | ||
|
||
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import heapq | ||
n, m = map(int,input().split()) | ||
|
||
#ํ ๊ตฌ์กฐ๋ก ๋ณํ | ||
numbers = list(map(int,input().split())) | ||
heapq.heapify(numbers) | ||
|
||
for _ in range(m): | ||
|
||
x = heapq.heappop(numbers) | ||
y = heapq.heappop(numbers) | ||
|
||
# x์ y ๋ ๋ค ๊ฐ ๊ต์ฒด | ||
heapq.heappush(numbers, x+y) | ||
heapq.heappush(numbers, x+y) | ||
|
||
print(sum(numbers)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import sys | ||
from collections import deque | ||
input = sys.stdin.readline | ||
|
||
n = int(input().strip()) | ||
queue = deque([i for i in range(1, n+1)]) | ||
result = [] | ||
|
||
while len(queue) > 1: | ||
result.append(queue.popleft()) | ||
queue.append(queue.popleft()) | ||
else: | ||
result.append(queue.popleft()) | ||
print(" ".join(map(str, result))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import sys | ||
input = sys.stdin.readline | ||
|
||
n = int(input()) | ||
graph = [list(input().strip()) for _ in range(n)] | ||
visited = [[0] * n for _ in range(n)] | ||
|
||
for k in range(n): | ||
for i in range(n): | ||
for j in range(n): | ||
if i == j: | ||
continue | ||
|
||
# 2-์น๊ตฌ์ธ ๊ฒฝ์ฐ | ||
if graph[i][j] == 'Y' or (graph[i][k] == 'Y' and graph[k][j] == 'Y'): | ||
visited [i][j] = 1 | ||
|
||
res = 0 | ||
for row in visited: | ||
res = max(res,sum(row)) | ||
print(res) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ๋ฅผ ์ด์ฉํด์ ํจ์จ์ ์ธ ์ฐ์ฐ์ ์ด์ฉํ ์ ์์๊ตฐ์! ์งฑ์ด์ญ๋๋ค๐ฅน๐ฅน