Buggy python submission (verdict: Runtime Error):
N = int(input())
A = tuple(map(int, input().split()))
r = 1
cnt = 1
T = A[0]
t = 1
flg = False
for l in range(N):
  while True:
    if T ^ A[r] == T + A[r]:
      t += 1
      cnt += t
      T += A[r]
      r += 1
    else:
      T -= A[l]
      t -= 1
      break
    if r == N:
      flg = True
      break
  if flg:
    break
print(cnt) 

Fixed submission:
N = int(input())
A = tuple(map(int, input().split()))
if len(A) == 1:
  print(1)
  exit()
r = 1
cnt = 1
T = A[0]
t = 1
flg = False
for l in range(N):
  while True:
    if T ^ A[r] == T + A[r]:
      t += 1
      cnt += t
      T += A[r]
      r += 1
    else:
      T -= A[l]
      t -= 1
      break
    if r == N:
      flg = True
      break
  if flg:
    break
print(cnt)

Buggy python submission (verdict: Runtime Error):
import numpy as np

def main():
  N = int(input())
  A = np.asarray(list(map(int, input().split())), dtype=np.float32)
  r = 1
  cnt = 1
  T = A[0]
  t = 1
  flg = False
  for l in range(N):
    while True:
      if int(T) ^ int(A[r]) == T + A[r]:
        t += 1
        cnt += t
        T += A[r]
        r += 1
      else:
        T -= A[l]
        t -= 1
        break
      if r == N:
        flg = True
        break
    if flg:
      break
  print(cnt)  

main()


Fixed submission:
N = int(input())
A = tuple(map(int, input().split()))
if len(A) == 1:
  print(1)
  exit()
r = 1
cnt = 1
T = A[0]
t = 1
flg = False
for l in range(N):
  while True:
    if T ^ A[r] == T + A[r]:
      t += 1
      cnt += t
      T += A[r]
      r += 1
    else:
      T -= A[l]
      t -= 1
      break
    if r == N:
      flg = True
      break
  if flg:
    break
print(cnt)

Buggy python submission (verdict: Runtime Error):
import numpy as np

def main():
  N = int(input())
  A = np.asarray(list(map(int, input().split())))
  r = 1
  cnt = 1
  T = A[0]
  t = 1
  flg = False
  for l in range(N):
    while True:
      if T ^ A[r] == T + A[r]:
        t += 1
        cnt += t
        T += A[r]
        r += 1
      else:
        T -= A[l]
        t -= 1
        break
      if r == N:
        flg = True
        break
    if flg:
      break
  print(cnt)  

main()


Fixed submission:
N = int(input())
A = tuple(map(int, input().split()))
if len(A) == 1:
  print(1)
  exit()
r = 1
cnt = 1
T = A[0]
t = 1
flg = False
for l in range(N):
  while True:
    if T ^ A[r] == T + A[r]:
      t += 1
      cnt += t
      T += A[r]
      r += 1
    else:
      T -= A[l]
      t -= 1
      break
    if r == N:
      flg = True
      break
  if flg:
    break
print(cnt)

Buggy python submission (verdict: Runtime Error):
def main():
  N = int(input())
  A = tuple(map(int, input().split()))
  r = 1
  cnt = 1
  T = A[0]
  t = 1
  flg = False
  for l in range(N):
    while True:
      if T ^ A[r] == T + A[r]:
        t += 1
        cnt += t
        T += A[r]
        r += 1
      else:
        T -= A[l]
        t -= 1
        break
      if r == N:
        flg = True
        break
    if flg:
      break
  print(cnt)  

main()

Fixed submission:
N = int(input())
A = tuple(map(int, input().split()))
if len(A) == 1:
  print(1)
  exit()
r = 1
cnt = 1
T = A[0]
t = 1
flg = False
for l in range(N):
  while True:
    if T ^ A[r] == T + A[r]:
      t += 1
      cnt += t
      T += A[r]
      r += 1
    else:
      T -= A[l]
      t -= 1
      break
    if r == N:
      flg = True
      break
  if flg:
    break
print(cnt)

Buggy python submission (verdict: Runtime Error):
def main():
  N = int(input())
  A = list(map(int, input().split()))
  r = 1
  cnt = 1
  T = A[0]
  t = 1
  flg = False
  for l in range(N):
    while True:
      if T ^ A[r] == T + A[r]:
        t += 1
        cnt += t
        T += A[r]
        r += 1
      else:
        T -= A[l]
        t -= 1
        break
      if r == N:
        flg = True
        break
    if flg:
      break
  print(cnt)  

main()

Fixed submission:
N = int(input())
A = tuple(map(int, input().split()))
if len(A) == 1:
  print(1)
  exit()
r = 1
cnt = 1
T = A[0]
t = 1
flg = False
for l in range(N):
  while True:
    if T ^ A[r] == T + A[r]:
      t += 1
      cnt += t
      T += A[r]
      r += 1
    else:
      T -= A[l]
      t -= 1
      break
    if r == N:
      flg = True
      break
  if flg:
    break
print(cnt)