728x90
반응형
백준 BAEKJOON 13118번 뉴턴과 사과 [PYTHON/파이썬]
<문제 출처> (BRONZE Ⅳ)
https://www.acmicpc.net/problem/13118
<풀이>
사과의 위치가 사람들이 서있는 위치와 동일한지 파악하면 된다.
<코드>
pos = list(map(int, input().split()))
apple = list(map(int, input().split()))
if apple[0] in pos:
print(pos.index(apple[0]) + 1)
else:
print(0)
728x90
반응형
'ALGORITHM > PYTHON' 카테고리의 다른 글
백준 BAEKJOON 10599번 페르시아의 왕들 [PYTHON/파이썬] (0) | 2024.01.14 |
---|---|
백준 BAEKJOON 3035번 스캐너 [PYTHON/파이썬] (1) | 2024.01.09 |
백준 BAEKJOON 1764번 듣보잡 [PYTHON/파이썬] (0) | 2024.01.07 |
백준 BAEKJOON 11094번 꿍 가라사대 [PYTHON/파이썬] (0) | 2024.01.06 |
백준 BAEKJOON 30204번 병영외 급식 [PYTHON/파이썬] (0) | 2024.01.05 |