Problem p03287 (python)

Fixed submission:
import collections
import numpy as np

N,M = list(map(int,input().split()))
A = input().split()

A = np.array(A,dtype='int64')
C = np.append([0],np.cumsum(A))
L = [i%M for i in C]
L_c = collections.Counter(L)

ans = 0
for i in L_c.values():
    S = i * (i-1) / 2
    ans+=S
    
print(int(ans))

Buggy submission (verdict: Runtime Error):
from collections import Counter
import numpy as np

N,M = list(map(int,input().split()))
A = np.array(input().split(),dtype='int64')
C = np.append([0],np.cumsum(A))
#累積和を算出して最初に０をつける。
L = C%M
#Ｍで割ったあまりを求めてリスト化
L_c = collections.Counter(L)
#各余りに対して、その数が何個あるかを求める。

ans = 0
for i in d.values():
    S = i * (i-1) / 2
    ans+=S
    
print(int(ans))

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

N,M = list(map(int,input().split()))
A = input().split()

A = np.array(A,dtype='int64')
C = np.append([0],np.cumsum(A))
#累積和を算出して最初に０をつける。
L = [i%M for i in C]
#Ｍで割ったあまりを求めてリスト化
d = defaultdict(int)
for i in L:
    d[i] +=1
#各余りに対して、その数が何個あるかを求める。

ans = 0
for i in d.values():
    S = i * (i-1) / 2
    ans+=S
    
print(int(ans))

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

N,M = list(map(int,input().split()))
A = input().split()

A = np.array(A,dtype='int64')
C = np.append([0],np.cumsum(A))
L = [i%M for i in C]
L_c = collections.Counter(L)

ans = 0
for i in L_c.values():
	S = i * (i-1) / 2
    ans+=S
print(int(ans))

Buggy submission (verdict: Runtime Error):
import numoy as np
N,M = list(map(int,input().split()))
A = input().split()

count = 0
A = np.array(A,dtype='int64')
B = np.cumsum(A)
C = np.append([0],B)

L = [1 for i in range(len(C)) for t in range(len(C)) if i<t and (C[t] - C[i])%M==0]
print(len(L))

Buggy submission (verdict: Runtime Error):
import numoy as np
N,M = list(map(int,input().split()))
A = input().split()

count = 0
A = np.array(A,dtype='int64')
B = np.cumsum(A)
C = np.append([0],B)

L = list(1 for i in range(len(C)) for t in range(len(C)) if i<t and (C[t] - C[i])%M==0)
print(len(L))

Buggy submission (verdict: Runtime Error):
import numoy as np
N,M = list(map(int,input().split()))
A = input().split()

count = 0
A = np.array(A,dtype='int64')
B = np.cumsum(A)
C = np.append([0],B)

L = [1 for i in range(len(C)) for t in range(len(C)) if i<t and (C[t] - C[i])%M==0]
print(len(L))

Buggy submission (verdict: Runtime Error):
import numoy as np
N,M = list(map(int,input().split()))
A = input().split()

count = 0
A = np.array(A,dtype='int64')
B = np.cumsum(A)
C = np.append([0],B)

L = (1 for i in range(len(C)) for t in range(len(C)) if i<t and (C[t] - C[i])%M==0)
print(len(list(L)))

Buggy submission (verdict: Runtime Error):
import numoy as np
N,M = list(map(int,input().split()))
A = input().split()

count = 0
A = np.array(A,dtype='int64')
B = np.cumsum(A)
C = np.append([0],B)

L = (1 for i in range(N+1) for t in range(N+1))
print(len(list(L)))

Buggy submission (verdict: Runtime Error):
import numoy as np
N,M = list(map(int,input().split()))
A = input().split()


count = 0
A = np.array(A,dtype='int64')
B = np.cumsum(A)
C = np.append([0],B)

L = (1 for i in range(N+1) for t in range(N+1) if i<t and (C[t] - C[i])%M==0)
print(len(list(L)))

Buggy submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
A = input().split()

count = 0
A = np.array(A,dtype='int64')
B = np.cumsum(A)
C = np.append([0],B)

L = (1 for i in range(N+1) for t in range(N+1) if i<t and (C[t] - C[i])%M==0)
print(len(list(L)))

Buggy submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
A = input().split()

count = 0
A = np.array(A,dtype='int64')
B = np.cumsum(A)
C = np.append([0],B)

L = (1 for i in range(N) for t in range(N) if i<t and (C[t] - C[i])%M==0)
print(len(list(L)))

Buggy submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
A = input().split()

count = 0
A = np.array(A,dtype='int64')
B = np.cumsum(A)
C = np.append([0],B)

L = (1 for i in range(N+1) for t in range(N+1) if i<t and (C[t] - C[i])%M==0)
print(len(list(L)))

Buggy submission (verdict: Runtime Error):
count = 0
for i in range(N+1):
    for t in range(N+1):
        if i<t:
            count+=1 if sum(A[i:t])%M==0 and sum(A[i:t]) != 0 else  0
print(count)