반응형
Notice
Recent Posts
Recent Comments
Link
목록2025/02/03 (1)
동캄의 코딩도장
백준 30804 [과일탕후루] 파이썬
https://www.acmicpc.net/problem/30804 투포인터를 적용하는 문제다. 처음에 잘못 풀었다. '''# 백준 30804 과일 탕후루import sysN=int(sys.stdin.readline())fruits=list(map(int,sys.stdin.readline().rstrip().split()))ans=0i=0new_start_ind=0if N==1: print(1)else: while i얘를들어103 1 2 2 1 1 1 1 1 1 과 같은 입력이 있다고하면3 11 2 2 1 1 1 1 1 1 이렇게 두번만 연산하면 되지만위의 케이스는3 11 2 22 2 1 1 1 1 1 11 1 1 1 1 1 로 연산을 더 많이한다. 따라서 위의 케이스를 고려해주면# 백준 ..
코테/BOJ
2025. 2. 3. 16:49