Skip to content

Commit f706925

Browse files
committed
109차 1번 문제풀이(푸는중)
1 parent c13e3ea commit f706925

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import sys
2+
3+
input = sys.stdin.readline
4+
5+
n, m = map(int, input().split())
6+
a = list(map(int, input().split()))
7+
8+
start, end = 0, 0
9+
total = a[0]
10+
cnt = 0
11+
while start <= end:
12+
if total % m == 0:
13+
cnt += 1
14+
15+
total -= a[start]
16+
start += 1
17+
end += 1
18+
if end < n:
19+
total += a[end]

0 commit comments

Comments
 (0)