Skip to content

Commit 1a093c2

Browse files
committed
[BOJ]부분합/ Silver /40min
https://www.acmicpc.net/problem/1806
1 parent 09428e6 commit 1a093c2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Hongjoo/백준/부분합.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
"""
2+
문제 : # 1806부분합
23
https://www.acmicpc.net/problem/1806
4+
5+
해설 :
6+
https://aia1235.tistory.com/46
7+
38
"""
49
import sys
510
N ,S = map(int, sys.stdin.readline().split())
@@ -17,11 +22,11 @@
1722
end += 1
1823
if end < N :
1924
partial_sum += arr[end]
20-
else : # 수열 끝 -> 조건 충족 x
25+
else : #반복문 끝
2126
break
2227

2328

24-
if min_length == 100000 :
29+
if min_length == 100000 : # 수열 끝 -> 조건 충족 x
2530
print(0)
2631
else :
2732
print(min_length)

0 commit comments

Comments
 (0)