Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- BOJ
- 다익스트라
- 딕셔너리
- 코딩테스트
- level2
- 백준
- 수학
- 브루트포스
- level1
- DP
- MYSQL
- dict
- 다이나믹 프로그래밍
- 가상메모리
- 그리디
- 스택
- 가상메모리 관리
- 프로그래머스
- 힙
- level3
- 구현
- dfs
- programmers
- 파이썬
- 재귀
- N과M
- level0
- 운영체제
- BFS
- python
Archives
- Today
- Total
동캄의 코딩도장
백준 7507 [올림픽 게임] 파이썬 본문
https://www.acmicpc.net/problem/7507
#백준 7507
import sys
tc=int(sys.stdin.readline())
for k in range(tc):
n=int(sys.stdin.readline())
lst=[]
for _ in range(n):
s=list(map(int,sys.stdin.readline().split()))
lst.append(s)
lst.sort(key=lambda x:(x[0],x[2],x[1]))
day=0
time=-1
count=0
for i in range(n):
if lst[i][0]>day:
day=lst[i][0]
time=lst[i][2]
count+=1
else:
if lst[i][1]>=time:
time=lst[i][2]
count+=1
print('Scenario #{}:'.format(k+1))
print(count)
print()
'코테 > BOJ' 카테고리의 다른 글
백준 20413 [MVP 다이아몬드 (Easy)] 파이썬 (0) | 2022.09.05 |
---|---|
백준 14400 [편의점 2] 파이썬 (0) | 2022.09.05 |
백준 21314 [민겸 수] 파이썬 (0) | 2022.09.04 |
백준 20310 [타노스] 파이썬 (0) | 2022.09.04 |
백준 20365 [블로그 2] 파이썬 (0) | 2022.09.04 |