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 |
Tags
- 웹어플리케이션 서버
- spring cloud
- 백준 16719
- Coroutine
- 백준 19238
- spring security
- JVM
- 프로그래머스
- MySQL
- re.split
- Spring
- java
- with recursive
- sql 기술면접
- 프로래머스
- spring oauth
- Kotlin
- 백준 15685
- springboot
- 백준 17779
- 백준 17626
- 백준 파이썬
- 백준
- 백준 16235
- java 기술면접
- Spring Boot
- JPA
- 백준 16236
- MSA
- 파이썬
Archives
- Today
- Total
목록백준 14467 (1)
시작이 반
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/SqhWd/btq0SlYAubZ/iiqabRc4kfe9Vr7DAlbKE1/img.png)
소 리스트를 만들어 처음 관찰된 소들은 해당 위치를 저장한다. 처음 관찰된 소가 아니면 저장된 위치와 해당 위치를 비교하여 다르면 count를 증가시킨다. n = int(input()) cow = [-1] * 11 cnt = 0 for _ in range(n): target_cow, position = map(int, input().split(' ')) if cow[target_cow] == -1: cow[target_cow] = position else: if cow[target_cow] != position: cnt += 1 cow[target_cow] = position print(cnt)
알고리즘/백준
2021. 3. 24. 18:02