본문 바로가기
python-algorithm

백준 16316 Baby Bites

by 무적김두칠 2023. 1. 4.

https://www.acmicpc.net/problem/16316

 

16316번: Baby Bites

The first line of input contains an integer n (1 ≤ n ≤ 1 000), the number of bites Arild receives. Then second line contains n space-separated words spoken by Arild, the i’th of which is either a non-negative integer ai (0 ≤ ai ≤ 10 000) or the s

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
def sol(nums):
    for i in range(1,len(nums)+1):
        if nums[i-1].isdigit() and int(nums[i-1]) != i:
                return 'something is fishy'
    return 'makes sense'
 
if __name__ == '__main__':
    n = int(input())
    nums = list(input().split())
    print(sol(nums))
cs
반응형

'python-algorithm' 카테고리의 다른 글

백준 10420 기념일 1  (0) 2023.01.04
백준 5220 Error Detection  (0) 2023.01.04
백준 6190 Another Cow Number Game  (0) 2023.01.03
백준 16861 Harshad Numbers  (0) 2023.01.03
백준 23343 JavaScript  (0) 2023.01.03

댓글