Problem p02802 (python)

Fixed submission:
N,M=map(int,input().split())
ac=[0]*N
wa=[0]*N

for i in range(M):
  p,s=input().split()
  if s=="WA" and ac[int(p)-1]==0:
    wa[int(p)-1]+=1
  elif s=="AC" and ac[int(p)-1]==0:
    ac[int(p)-1]+=1

penalty=[wa[k] for k in [i for i,j in enumerate(ac) if j!=0]]    
print("%d %d" % (sum(ac),sum(penalty)))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ac=[0]*N
wa=[0]*N

for i in range(M):
  p,s=input().split()
  if s=="WA" and ac[int(p)-1]==0:
    wa[int(p)-1]+=1
  elif s=="AC" and ac[int(p)-1]==0:
    ac[int(p)-1]+=1

penalty=[w[k] for k in [i for i,j in enumerate(ac) if j!=0]]    
print("%d %d" % (sum(ac),sum(penalty)))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ac=[0]*N
wa=[0]*N

for i in range(M):
  p,s=input().split()
  if s=="WA" and ac[int(p)-1]==0:
    wa[int(p)-1]+=1
  elif s=="AC" and ac[int(p)-1]==0:
    ac[int(p)-1]+=1

penalty=[w[k] for k in [i for i,j in enumerate(ac) if j!=0]]    
print("%d %d" %(sum(ac),sum(penalty)))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ac=[0]*N
wa=[0]*N

for i in range(M):
  p,s=input().split()
  if s=="WA" and ac[int(p)-1]==0:
    wa[int(p)-1]+=1
  elif s=="AC" and ac[int(p)-1]==0:
    ac[int(p)-1]+=1

penalty=[w(k) for k in [i for i,j in enumerate(ac) if j!=0]]    
print("%d %d" %())

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ac=[0]*N
wa=[0]*N

for i in range(M):
  p,s=input().split()
  if s=="WA" and ac(int(p)-1)==0:
    wa[int(p)-1]+=1
  elif s=="AC" and ac(int(p)-1)==0:
    ac[int(p)-1]+=1

penalty=[w(k) for k in [i for i,j in enumerate(ac) if j!=0]]    
print("%d %d" %(sum(ac),sum(penalty)))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ac=[0]*N
wa=[0]*N

for i in range(M):
  p,s=input().split()
  if s=="WA" and ac(int(p)-1)==0:
    wa[int(p)-1]+=1
  elif s=="AC" and ac(int(p)-1)==0:
    ac[int(p)-1]+=1

penalty=[w(k) for k in [i for i,j in enumerate(ac) if j!=0]]    
print("%d %d" %())

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
wa=[0]*N
ac=[0]*N

for i in range(M):
  p,s=map(int,input().split())
  if s=="WA" and ac[p-1]==0:
    wa[p-1]+=1
  if s=="AC" and ac[p-1]==0:
    ac[p-1]+=1

penalty=[wa[j] for j,k in enumerate(ac) if not K==0]
print("%d %d" %(sum(ac),sum()))

Buggy submission (verdict: Runtime Error):
def f(S,start_num,j):
  start=start_num[j-1]
  s=0
  for i in range(0,strat_num[j]-start_num[j-1]):
    if S[start+i]=="WA":
      s=s+1
      continue
    else:
      break
return s

N,M=map(int,input().split())
P_str=[0]*M
S=[0]*M
for i in range(M):
  P_str[i],S[i]=map(str,input().split())
P=[int(P_str[j]) for j in range(M)]

start_num=[0]*N
start_num[0]=0
for i in range(1,M):
    if not P[i-1]==P[i]:
      i=start_num[P[i]-1]

correct=0
for j in range(1,N+1):
  if f(S,start_num,j)<(start_num[j]-start_num[j-1]):
    correct+=1

penalty=0
for j in range(1,N+1):
  penalty+=f(S,start_num,j)

print(correct,"",penalty)

Buggy submission (verdict: Runtime Error):
def f(S,start_num,j):
  start=start_num[j-1]
  s=0
  for i in range(0,strat_num[j]-start_num[j-1]):
    if S[start+i]=="WA":
      s=s+1
      continue
    else:
      break
return s

N,M=map(int,input().split())
P_str=[0]*M
S=[0]*M
for i in range(M):
  P_str[i],S[i]=map(str,input().split())
P=[int(P_str[j]) for j in range(M)]

start_num=[0]*N
start_num[0]=1
for i in range(1,M):
    if not P[i-1]==P[i]:
      i=start_num[P[i]-1]

correct=0
for j in range(1,N+1):
  if f(S,start_num,j)<(start_num[j]-start_num[j-1]):
    correct+=1
penalty=0
for j in range(1,N+1):
  penalty+=f(S,start_num,j)

print(correct,"",penalty)