baekjoon 20260203

This commit is contained in:
songyc macbook 2026-02-03 21:06:22 +09:00
parent 6a49b56c53
commit 3f90e25b13

View File

@ -0,0 +1,15 @@
let N = Int(readLine()!)
var nums = (readLine()!).split(separator: " ").compactMap{Int($0)}
var score = 0
var ans = 0
for n in nums {
if n==0 {
score = 0
continue
}
score += 1
ans += score
}
print(ans)