Skip to content

Commit

Permalink
Merge pull request #51 from AlgoLeadMe/16-pu2rile
Browse files Browse the repository at this point in the history
16-pu2rile
  • Loading branch information
pu2rile authored Sep 24, 2024
2 parents 72fc116 + 0cef2f0 commit 14d57f2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
Binary file added honggukang0623/.DS_Store
Binary file not shown.
Binary file modified pu2rile/.DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion pu2rile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
| 12์ฐจ์‹œ | 2024.07.23 | ๋™์  ํ”„๋กœ๊ทธ๋ž˜๋ฐ | [1ํ•™๋…„](https://www.acmicpc.net/problem/5557) | [#40](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/40)
| 13์ฐจ์‹œ | 2024.07.26 | ์Šคํƒ | [ํ›„์œ„ ํ‘œ๊ธฐ์‹](https://www.acmicpc.net/problem/1918) | [#43](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/43)
| 14์ฐจ์‹œ | 2024.08.05 | ํŠธ๋ฆฌ | [์ด์ง„ ํƒ์ƒ‰ ํŠธ๋ฆฌ](https://www.acmicpc.net/problem/5639) | [#45](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/45)
| 15์ฐจ์‹œ | 2024.08.15 | ํŠธ๋ฆฌ | [๋‚˜๋ฌด ํƒˆ์ถœ](https://www.acmicpc.net/problem/15900) | [#48](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/48)
| 15์ฐจ์‹œ | 2024.08.15 | ํŠธ๋ฆฌ | [๋‚˜๋ฌด ํƒˆ์ถœ](https://www.acmicpc.net/problem/15900) | [#48](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/48)
| 16์ฐจ์‹œ | 2024.09.15 | ๊ทธ๋ฆฌ๋”” ์•Œ๊ณ ๋ฆฌ์ฆ˜ | [์‹ ์ž… ์‚ฌ์›](https://www.acmicpc.net/problem/15900) | [#51](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/51)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
T = int(input())

for _ in range(T):
N = int(input())
score = [list(map(int, input().split())) for _ in range(N)]

# ์„œ๋ฅ˜ ์‹ฌ์‚ฌ ์„ฑ์  ๊ธฐ์ค€์œผ๋กœ ์˜ค๋ฆ„์ฐจ์ˆœ ์ •๋ ฌ
rank_1 = sorted(score)
top = 0 # ์„œ๋ฅ˜ ์„ฑ์ ์ด ๊ฐ€์žฅ ์ข‹์€ ์‚ฌ๋žŒ์„ ๊ธฐ์ค€์œผ๋กœ ์„ค์ • (์ฒซ ๋ฒˆ์งธ ์‚ฌ๋žŒ)
result = 1 # ์ฒซ ๋ฒˆ์งธ ์ง€์›์ž๋Š” ํ•ญ์ƒ ํ•ฉ๊ฒฉํ•˜๋ฏ€๋กœ ๊ฒฐ๊ณผ๋ฅผ 1๋กœ ์‹œ์ž‘

# 2๋ฒˆ์งธ ์ง€์›์ž๋ถ€ํ„ฐ ์„œ๋ฅ˜ ์„ฑ์  ์ˆœ์œผ๋กœ ๋ฉด์ ‘ ์„ฑ์  ๋น„๊ต
for i in range(1, len(rank_1)):
# ํ˜„์žฌ ์ง€์›์ž์˜ ๋ฉด์ ‘ ์„ฑ์ ์ด ๊ธฐ์ค€์ (top)์˜ ์ง€์›์ž๋ณด๋‹ค ์ข‹์œผ๋ฉด (์ˆซ์ž๊ฐ€ ๋‚ฎ์œผ๋ฉด)
if rank_1[i][1] < rank_1[top][1]:
top = i # ๊ธฐ์ค€์ (top)์„ ํ˜„์žฌ ์ง€์›์ž๋กœ ๊ฐฑ์‹ 
result += 1

print(result)

0 comments on commit 14d57f2

Please sign in to comment.