-
[python]백준 공 1547번알고리즘 문제풀이/백준(파이썬) 2023. 5. 12. 23:48
코드
import sys sys.stdin = open("1547.txt", "r") n=int(input()) q=[1,2,3] for _ in range(n): a,b=map(int,input().split()) a1=q.index(a) b2=q.index(b) q[a1],q[b2]=q[b2],q[a1] print(q[0])
링크
https://www.acmicpc.net/problem/1547
'알고리즘 문제풀이 > 백준(파이썬)' 카테고리의 다른 글
[python]백준 연속구간 2495번 (0) 2023.05.14 [python]백준 0123456789 6916번 (1) 2023.05.13 [python]백준 핸드폰 요금 1267번 (0) 2023.05.11 [python]백준 베라의 패션 15439번 (0) 2023.05.10 [python]백준 AFC 윔블던 4299번 (0) 2023.05.09