Skip to content

Commit

Permalink
202-12-31
Browse files Browse the repository at this point in the history
  • Loading branch information
H0ngJu committed Dec 31, 2024
1 parent 00438a2 commit 2e22124
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions H0ngJu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@
| 34์ฐจ์‹œ | 2024.11.19 | ๋ˆ„์ ํ•ฉ | [๊ฐœ๋˜ฅ๋ฒŒ๋ ˆ](https://www.acmicpc.net/problem/3020) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/256 |
| 35์ฐจ์‹œ | 2024.11.23 | DP | [์ „๊นƒ์ค„](https://www.acmicpc.net/problem/2565) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/258 |
| 36์ฐจ์‹œ | 2024.12.02 | ์ˆ˜ํ•™ | [๋จธ๋ฆฌ ํ†กํ†ก](https://www.acmicpc.net/problem/1241) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/260 |
| 36์ฐจ์‹œ | 2024.12.31 | ๊ทธ๋ฆฌ๋”” | [ํšŒ์˜์‹ค ๋ฐฐ์ •](https://www.acmicpc.net/problem/1931) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/261 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import sys

def input() : return sys.stdin.readline().rstrip()

N = int(input()) # 100000
info = [tuple(map(int, input().split())) for _ in range(N)]


info.sort(key=lambda x: (x[1], x[0]))
# ์ตœ๋Œ€ํ•œ ๋งŽ์ด ๋„ฃ์œผ๋ ค๋ฉด ๋นจ๋ฆฌ ๋๋‚˜๋Š” ํšŒ์˜๋“ค์„ ์ •๋ ฌ์„ ํ•ด์•ผํ•จ
# ** ๋๋‚˜๋Š” ์‹œ๊ฐ„์ด ๊ฐ™์€ ๊ฒฝ์šฐ๋ฅผ ๊ณ ๋ คํ•ด์•ผํ•จ **

tmp_a,tmp_b = info[0][0], info[0][1]
answer = 1

for i in range(1,N):
a = info[i][0]
b = info[i][1]

if a >= tmp_b:
tmp_a, tmp_b = a, b
answer += 1

print(answer)

0 comments on commit 2e22124

Please sign in to comment.