반응형
제출한 코드
A, B, N = map(int, input().split())
a = 10000
for i in range(N):
cost, num = map(int, input().split())
lst = list(map(int, input().split()))
try:
lst.index(B, lst.index(A))
if a > cost :
a = cost
except :
pass
if a < 1001:
print(a)
else:
print(-1)
결과

후기
반응형
'BQJ 백준 > python' 카테고리의 다른 글
[Python/파이썬] 백준 1547번: 공 (0) | 2024.06.14 |
---|---|
[Python/파이썬] 백준 1546번: 평균 (0) | 2024.06.14 |
[Python/파이썬] 백준 30306번: Better Dice (0) | 2024.06.13 |
[Python/파이썬] 백준 1330번: 두 수 비교하기 (0) | 2024.06.12 |
[Python/파이썬] 백준 1316번: 그룹 단어 체커 (0) | 2024.06.11 |