ZhenlongDai/ACPR huggingface dataset:
Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
H=list(map(int,input().split()))
count=1
flag=1
for i in range(N):
    flag=1
    for j in range(i):
        if H[i]<H[j]:
            flag=0
            break
    if flag==1:
        count+=1
print(count)

Failing test case input:
5
0 3 1 2 2

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N=int(input())
H=list(map(int,input().split()))
count=0
flag=1
for i in range(N):
    flag=1
    for j in range(i):
        if H[i]<H[j]:
            flag=0
            break
    if flag==1:
        count+=1
print(count)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

res = 0
for indexa, valuea in enumerate(a):
  for indexb, valueb in enumerate(a):
    if indexa == indexb:
      res += 1
    if valuea < valueb:
      break
    if indexa > indexb :
      break

print(res)

Failing test case input:
5
3 3 6 1 0

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

res = 0
for indexa, valuea in enumerate(a):
  for indexb, valueb in enumerate(a):
    if valuea < valueb and indexa != indexb:
      break
    if indexa == indexb:
      res += 1

print(res)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
n = int(n)
l=[]
l=input().split(" ")
maximum=l[0]
c=1
for i in range(1,n):
	if(l[i]>=maximum):
		maximum=l[i]
		c=c+1
print(c)

Failing test case input:
4
9 2 0 15

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = input()
n = int(n)
l=[i for i in map(int,input().split())]
maximum=l[0]
c=0
for i in range(n):
	if(l[i]>=maximum):
		maximum=l[i]
		c=c+1
print(c)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
h = list(map(int, input().split()))
count = 0
for i in range(n):
     if h[i] >= h[0]:
          count += 1
print(count)

Failing test case input:
5
1 0 -1 9 2

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
h = list(map(int, input().split()))
count = 0
for i in range(n):
     if max(h[:i+1]) <= h[i]:
          count += 1
print(count)

Problem: p03072
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
hlist = list(map(int,input().split()))
kijun = hlist[0]
ans = 1

for x in range(1,n):
  if kijun <= hlist[x] and hlist[x]>=max(hlist):
    ans += 1
    
print(ans)

Failing test case input:
5
0 2 0 7 2

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
hlist = list(map(int,input().split()))
kijun = hlist[0]
ans = 0
max = hlist[0]

for x in range(0,n):
  if hlist[x] >= max:
    max = hlist[x]
    ans+=1
  
    
print(ans)
Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N= int(input())
b = list(map(int,input().split()))

max = b[0]
ans = 1
for i in range(0,N):
    flag = False
    for t in range(0,i):
        
        if b[i] <= b[t]:
            flag = True
    if flag == True:
        ans += 1

print(ans)

Failing test case input:
5
1 0 0 7 2

Expected output:
2


Actual output:
4


Fixed submission (verdict: Accepted):

N = int(input())
b = list(map(int,input().split()))

ans = 0
for i in range(0,N):
    flag = True
    for t in range(0,i):
        
        if b[t] > b[i]:
            flag = False
            break
    if flag == True:
        ans += 1

print(ans)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
Hs = input().strip().split(' ')
ans = 0;
H = 0;
for i in Hs:
  i = int(i)
  if (i > H):
  	ans += 1
  H = max(H, i)

print(ans)

Failing test case input:
5
2 5 3 4 2

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N = input()
Hs = input().strip().split(' ')
ans = 0;
H = 0;
for i in Hs:
  i = int(i)
  if (i >= H):
  	ans += 1
  H = max(H, i)

print(ans)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
h=list(map(int,input().split()))
ans=1
for i in range(1,n):
  if h[i-1]<=h[i]:
    ans+=1
print(ans)
  

Failing test case input:
4
18 2 -1 3

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
h=list(map(int,input().split()))
ans=1
for i in range(1,n):
  r=True
  for j in range(i):
    if h[i]<h[j]:
      r=False
  if r==True:
    ans+=1
print(ans)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int,input().split()))
count = 0
level = 0
for i in H:
    if i > level:
        level = i
        count += 1
print(count)

Failing test case input:
5
0 8 2 6 1

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int,input().split()))
count = 0
level = 0
for i in H:
    if i >= level:
        level = i
        count += 1
print(count)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
H=map(int,input().split())
m=0
c=0
for h in H:
  c += 1 if h>m else 0
  m=max(m,h)
print(c)

Failing test case input:
5
0 1 0 7 2

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N=int(input())
H=map(int,input().split())
m=0
c=0
for h in H:
  c += 1 if h>=m else 0
  m=max(m,h)
print(c)
Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline




def main():
	N = int(input())
	H = input().split(" ")

	ans = 0
	max = 0
	for i, val in enumerate(H):
		if i == 0:
			ans += 1
			max = val
			continue
		if max < val:
			max = val
		if max <= H[i]:
			ans += 1

	print(ans)



	
	
if __name__ == "__main__":
	main()
	

Failing test case input:
4
20 0 0 3

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
input = sys.stdin.readline




def main():
	N = int(input())
	H = input().split(" ")
	H = [int(s) for s in H]
	

		



 
	ans = 0
	max = 0
	for i, val in enumerate(H):
		if i == 0:
			ans += 1
			max = val
			continue
		if max <= val:
			max = val
			ans += 1
			
 
	print(ans)

	
	
if __name__ == "__main__":
	main()

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input("N"))
H = list(map(int, input("H").split(" ")))

m=0
num = 0
for h in H:
    if h>=m:
        num +=1
        m=h

print(num)


Failing test case input:
5
4 4 3 2 4

Expected output:
3


Actual output:
NH3


Fixed submission (verdict: Accepted):
N=int(input())
H = list(map(int, input().split(" ")))

m=0
num = 0
for h in H:
    if h>=m:
        num +=1
        m=h

print(num)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list( map( int, input().split() ) )
cnt = 1
for k in range(N-1):
  if H[k+1] >= H[k]:
    cnt += 1
  else:
    break
print(cnt)

Failing test case input:
5
0 4 2 6 2

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
H = list( map( int, input().split() ) )
cnt = 0
threshold = 0
for k in range(N):
  if threshold <= H[k]:
    cnt += 1
    threshold = H[k]
print(cnt)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
cnt = 1

for i in range(0, N):
  for j in range(i+1):
    print(H[i], H[j])
    if H[i] <= H[j]:
      if i == j:
        cnt += 1
      else:
        continue
    else:
      break
        
print(cnt)

Failing test case input:
5
1 0 -1 9 2

Expected output:
2


Actual output:
1 1
0 1
0 0
-1 1
-1 0
-1 -1
9 1
2 1
4


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
cnt = 1

for i in range(N):
  flg = False
  for j in range(0, i):
    if H[j] <= H[i]:
      flg = True
    else:
      flg = False
      break
  if flg == True:
    cnt += 1
        
print(cnt)

Problem: p03072
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
H=list(map(int,input().split()))
ans=0
hgt=0
for i in range(n):
    H[i]>=hgt
    ans+=1
    hgt=max(hgt,H[i])
print(ans)

Failing test case input:
4
34 0 -1 3

Expected output:
1


Actual output:
4


Fixed submission (verdict: Accepted):
n=int(input())
H=list(map(int,input().split()))
ans=0
hgt=0
for i in range(n):
    if H[i]>=hgt:
        ans+=1
    hgt=max(hgt,H[i])
print(ans)
Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
x = 0
h = map(int, input().split())
h = list(h)
for i in range(n):
    if h[0] <= h[i]:
        x += 1
print(x)

Failing test case input:
5
0 0 0 7 2

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
x = 0
h = list(map(int, input().split()))
max = h[0]
for i in range(n):
    if max <= h[i]:
        x += 1
        max = h[i]
print(x)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
h=list(map(int,input().split()))
c=1
if len(h)>1 and h[0]<=h[1]:
  c=2
for i in range(2,n):
  if h[i]>=max(h[0:i-1]):
    c+=1
print(c)

Failing test case input:
5
0 1 0 7 2

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
n=int(input())
h=list(map(int,input().split()))
c=1
if len(h)>1 and h[0]<=h[1]:
  c=2
for i in range(2,n):
  if h[i]>=max(h[0:i]):
    c+=1
print(c)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
H=list(map(int,input().split()))
count=1
for i in range(N-1):
    if H[i]<=H[i+1]:
        count+=1
    else:
        break
print(count)

Failing test case input:
4
11 5 11 8

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N=int(input())
H=list(map(int,input().split()))
count=0
flag=1
for i in range(N):
    flag=1
    for j in range(i):
        if H[i]<H[j]:
            flag=0
            break
    if flag==1:
        count+=1
print(count)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
count = 1
for i in range(1,n):
    if a[0] <= a[i]:
        count+=1
print(count)

Failing test case input:
5
2 5 3 4 3

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
h = list(map(int,input().split()))
count = 0
maxh = 0
for i in h:
    if maxh <= i:
        maxh = i
        count += 1
print(count)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = input().split()
H = list(map(int, H))

count = 1

for i in range(1, N):
    del H[0]
    if(max(H) == H[0]):
        count += 1

print(count)

Failing test case input:
5
0 8 2 4 1

Expected output:
2


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
H = input().split()
H = list(map(int, H))

count = 0

for i in reversed(range(0, N)):
    if(max(H) == H[-1]):
        count += 1
    del H[-1]

print(count)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
x = 0
h = list(map(int, input().split()))
max = h[0]
for i in range(n):
    if max <= h[i] and h[i-1] <= h[i]:
        x += 1
        max = h[i]
print(x)

Failing test case input:
5
0 4 2 6 2

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
x = 0
h = list(map(int, input().split()))
max = h[0]
for i in range(n):
    if max <= h[i]:
        x += 1
        max = h[i]
print(x)
Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = [int(i) for i in input().split()]
b = a[0]
c = 0
ans = 0
for i in range(N-1):
  c += 1
  if b < a[c] and a[c - 1]  <a[c] :
    ans += 1
print(ans + 1) 

Failing test case input:
4
6 5 8 8

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
a = [int(i) for i in input().split()]
b = a[0]
c = 0
ans = 0
for i in range(N-1):
  c += 1
  if b <= a[c] :
    b = a[c]
    ans += 1
print(ans + 1)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())



h=list(map(int,input().split()))
a=h[0]
cnt=1
for i in range(1,n):
    if h[i-1]<=h[i] and a<=h[i]:
        cnt+=1
print(cnt)


Failing test case input:
5
2 5 3 4 1

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
h=list(map(int,input().split()))
tmp=h[0]
ans=0
for i in range(n):
    if tmp<=h[i]:
        ans+=1
        tmp=h[i]
print(ans)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
cnt = 1
res = 0
ans = 0
for i in range(1, N):
    if H[0] <= H[i] and H[i-1] <= H[i]:
        cnt += 1
        ans = max(cnt, res)

print(cnt)

Failing test case input:
5
0 8 2 4 1

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
cnt = 1
m = H[0]
for i in range(1, N):
    if m <= H[i] and H[i-1] <= H[i]:
        cnt += 1
        m = max(H[0], H[i])

print(cnt)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

H = list(map(int, input().split()))

cansee = False
count = 0

for i in range(N-1):
    cansee = True
    for j in range(i):
        if H[j] > H[i]:
            cansee = False
    if cansee:
        count += 1

print(count)

Failing test case input:
4
9 2 0 9

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())

H = list(map(int, input().split()))

count = 0

for i in range(N):
    cansee = True
    for j in range(i):
        if H[j] > H[i]:
            cansee = False
    
    if cansee:
        count += 1

print(count)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
mt_lst = list(map(int, input().split()))
cnt = 0

for i in range(len(mt_lst)):
    tmp = mt_lst[0:i+1]
    cnt += 1 if mt_lst[i] == max(tmp) else 0


Failing test case input:
5
9 -1 4 8 4

Expected output:
1


Actual output:

Fixed submission (verdict: Accepted):
N = input()
mt_lst = list(map(int, input().split()))
cnt = 0

for i in range(len(mt_lst)):
    tmp = mt_lst[0:i+1]
    cnt += 1 if mt_lst[i] == max(tmp) else 0

print(cnt)
Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,*H = map(int, open(0).read().split())

L = 0
for i in range(len(H)):
    if i == 0:
        L+=1
    elif H[i-1] <= H[i]:
        L+=1
print(L)

Failing test case input:
4
94 -1 -1 3

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
N,*H = map(int, open(0).read().split())

L = 0

for i in range(N):
    if i == 0:
        L+=1
    elif max(H[0:i]) <= H[i]:
        L+=1
print(L)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = list(map(int,input().split()))
cnt = 1
for i in range(n-1,0,-1):
    result = True
    for j in range(i-2,-1,-1):
        if s[j] > s[i]:
            result = False
            break
    if result:
        cnt +=1
print(cnt)

Failing test case input:
5
1 5 3 2 8

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
s = list(map(int,input().split()))
cnt = 1
for i in range(n-1,0,-1):
    result = True
    for j in range(i-1,-1,-1):
        if s[j] > s[i]:
            result = False
            break
    if result:
        cnt +=1
print(cnt)

Problem: p03072
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
h=list(map(int, input().split()))
ans=0
for i in range(n):
    if h[i]>=h[0]:
        ans=ans+1  
print(ans)

Failing test case input:
5
0 8 1 6 1

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
n=int(input())
h=list(map(int, input().split()))
x=1
ans=h[0]
for i in range(1,n):
    if h[i]>=ans:
        x=x+1 
        ans=h[i]
print(x)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
h=list(map(int,input().split()))
a=0
cnt=1
for i in range(1,n):
  if h[i]>=a:
    cnt+=1
  a=max(a,h[i-1])
print(cnt)

Failing test case input:
4
34 1 -2 3

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
h=list(map(int,input().split()))
a=h[0]
cnt=1
for i in range(1,n):
  if h[i]>=a:
    cnt+=1
  a=max(a,h[i])
print(cnt)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
ls = [int(i) for i in input().split()]
maxx = ls[0]
inns = 0
for i in range(len(ls)):
    if ls[i] >= maxx:
        inns += 1
    if ls[i] > maxx:
        maxx += ls[i]

print(inns)



Failing test case input:
5
4 5 3 5 4

Expected output:
3

Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
ls = [int(i) for i in input().split()]
maxx = ls[0]
inns = 0
for i in range(len(ls)):
    if ls[i] >= maxx:
        inns += 1
    if ls[i] > maxx:
        maxx =  ls[i]

print(inns)
Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
ListH = list(map(int,input().split()))
result = 1
for i in range(N-1):
    for k in range(i+1):
        out = False
        if k >= 0:
            print(ListH[k],ListH[i])
            if ListH[k] < ListH[i]:
                out = True
            if not out :
                result += 1
print(result)

Failing test case input:
5
2 5 3 4 1

Expected output:
2


Actual output:
2 2
2 5
5 5
2 3
5 3
3 3
2 4
5 4
3 4
4 4
7


Fixed submission (verdict: Accepted):
N = int(input())
ListH = list(map(int,input().split()))
result = 0
for i in range(N):
    out = False
    for k in range(i):
        if k >= 0:
            if ListH[k] > ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
cnt = 1
for i in range(1, N):
    if H[0] <= H[i]:
        cnt += 1
print(cnt)

Failing test case input:
5
4 4 8 2 4

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
cnt = 1
m = H[0]
for i in range(1, N):
    if m <= H[i] and H[i-1] <= H[i]:
        cnt += 1
        m = max(H[0], H[i])

print(cnt)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int,input().split()))
count = 1
x = H[0]
for i in range(N-1):
     if x <=H[i]:
         x = H[i]
         count += 1

print(count)
     


Failing test case input:
5
9 4 4 1 6

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int,input().split()))
count = 1
x = H[0]
for i in range(N-1):
     if x <=H[i+1]:
         x = H[i+1]
         count += 1

print(count)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int,input().split()))
c = 1
for i in range(1,N-1):
    for j in range(0,i-1):
        if H[j] - H[i] > 0:
            break
    else:
        c += 1
print(c)

Failing test case input:
5
1 0 -1 9 2

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int,input().split()))

c = 0
maxh = -1
for i in range(N):
    if maxh <= H[i]:
        c += 1
        maxh = H[i]
print(c)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
n = int(input())
h=list(map(int,input().split()))
print(h)
ans=1
ma=h[0]
for i in range(1,n):
    print(h[i])

Failing test case input:
4
9 2 0 8

Expected output:
1


Actual output:
[9, 2, 0, 8]
2
0
8


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
n = int(input())
h=list(map(int,input().split()))
ans=1
ma=h[0]
for i in range(1,n):
    if ma <= h[i]:
        ma = h[i]
        ans+=1
print(ans)
Problem: p03072
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
h = list(map(int,input().split()))
ans = 1
for i in range(1,n):
    if h[i-1] <= h[i]:
        ans += 1
    else:
        break
print(ans)


Failing test case input:
5
1 0 0 7 2

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
h = list(map(int,input().split()))
ans = 1
max_h = h[0]
for i in range(1,n):
    if max_h <= h[i]:
        ans += 1
    max_h = max(h[i],max_h)
print(ans)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
lst = [int(x) for x in input().split()]

count = 1
for i in range(0,n-1):
  if(lst[i]<lst[i+1]):
    count+=1
print(count)

Failing test case input:
5
0 4 1 2 2

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
lst = [int(x) for x in input().split()]

count = 1
for i in range(1,n):
  if(max(lst[0:i])<=lst[i]):
    count+=1
print(count)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
h=[int(i) for i in input().split()]
count=n
for i in reversed(range(1,n)):
    for j in reversed(range(0,n-1)):
        
        
        if h[i]<h[j]:
            count-=1
            break
print(count)

Failing test case input:
5
4 4 8 2 4

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
h=[int(i) for i in input().split()]
count=n
for i in reversed(range(1,n)):
    for j in reversed(range(0,i)):
        
        
        if h[i]<h[j]:
            count-=1
            break
print(count)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

res = 0
for indexa, valuea in enumerate(a):
  for indexb, valueb in enumerate(a):
    if valuea < valueb:
      break
    if indexa > indexb :
      break
    if indexa == indexb:
      res += 1

print(res)

Failing test case input:
5
3 4 4 1 0

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

res = 0
for indexa, valuea in enumerate(a):
  for indexb, valueb in enumerate(a):
    if valuea < valueb and indexa != indexb:
      break
    if indexa == indexb:
      res += 1

print(res)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import sys
input = sys.stdin.readline

def io_generator():
	return input()



def main(io):
	n=int(io())
	hs = list(map(int, io().split()))
	max_h=0
	for i, h in enumerate(hs):
		if h < max_h:
			return i
		
		max_h=max(max_h, h)
	return n



if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

Failing test case input:
4
6 5 8 8

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):


import sys
input = sys.stdin.readline

def io_generator():
	return input()



def main(io):
	n=int(io())
	hs = list(map(int, io().split()))
	max_h=0
	nn=0
	for i, h in enumerate(hs):
		if h >= max_h:
			nn+=1
			max_h=h
	return nn



if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))
Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = sorted([int(x) for x in input().split()])

ans = -1
b = 0
for i in range(N):
    if H[i] >= b:
        ans = ans + 1
        b = H[i]

print(ans)


Failing test case input:
5
1 5 3 2 5

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))

ans = 0
b = 0
for i in range(N):
    if H[i] >= b:
        ans += 1
        b = H[i]

print(ans)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
H=list(map(int,input().split()))
c=1
for i in range(1,n-1):
    if max(H[:i])>H[i+1]:break
    c += 1
print(c)

Failing test case input:
5
4 5 3 1 4

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n=int(input())
H=list(map(int,input().split()))
c=1
for i in range(1,n):
    if max(H[:i])<=H[i]:
        c += 1
print(c)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
ListH = list(map(int,input().split()))
result = 1
for i in range(N):
    out = False
    for k in range(i):
        if k >= 0:
            if ListH[k] > ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

Failing test case input:
5
4 4 3 3 4

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
ListH = list(map(int,input().split()))
result = 0
for i in range(N):
    out = False
    for k in range(i):
        if k >= 0:
            if ListH[k] > ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
list_ = input().split()
K = 0
H = list_[0]
for i in range(0,len(list_)):
 if list_[i] >= H:
  K += 1
  H = list_[i]
print(K)

Failing test case input:
4
24 0 0 3

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
list_ = input().split()
K = 1
H = int(list_[0])
for i in range(1,N):
 if int(list_[i]) >= H:
  K += 1
  H = int(list_[i])
print(K)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
n=int(input())
h=list(map(int, input().split()))
count=0
max=0
for i in range(n-1):
    if h[i]>=max:
        max=h[i]
        count+=1
print(count)

Failing test case input:
5
1 5 3 2 5

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
import sys
n=int(input())
h=list(map(int, input().split()))
count=0
max=0
for i in range(n):
    if h[i]>=max:
        max=h[i]
        count+=1
print(count)
Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int,input().split()))

a = 1
b = list()
for i in range(N):
    try:
        if H[i] - H[i-1] > 0:
            a += 1
        else:
            break
    except:
        pass
print(a)

Failing test case input:
4
34 1 -2 3

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int,input().split()))

a = 1
for i in range(1,N):
    if H[i] - max(H[:i]) >= 0:
        a += 1
    else:
        pass
print(a)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h_list = map(int, input().split())
a = 0
b = 0
for h in h_list:
  if h <= b:
    b = h
    a += 1
print(a)


Failing test case input:
5
9 2 4 2 4

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n = input()
h_list = map(int, input().split())
a = 0
b = 0
for h in h_list:
  if b <= h:
    b = h
    a += 1
print(a)

Problem: p03072
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
ans = 1
for i in range(1, N):
	if H[i - 1] <= H[i]:
		ans += 1
print(ans)



Failing test case input:
5
4 4 10 2 4

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
h = H[0]
ans = 1
for i in range(1, N):
	if H[i] >= h:
		ans += 1
	h = max(H[i], h)
print(ans)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
h = list(map(int,input().split()))
ls = []
d = 1
for i in range(n-1):
    ls.append(h[i])
    print(ls)
    c = 0
    for j in range(len(ls)):
        if ls[j] <= h[i+1]:
            c += 1
        if c == len(ls):
            d += 1
        
print(d)

Failing test case input:
5
4 4 3 0 2

Expected output:
2


Actual output:
[4]
[4, 4]
[4, 4, 3]
[4, 4, 3, 0]
2


Fixed submission (verdict: Accepted):
n = int(input())
h = list(map(int,input().split()))
ls = []
d = 1
for i in range(n-1):
    ls.append(h[i])
    c = 0
    for j in range(len(ls)):
        if ls[j] <= h[i+1]:
            c += 1
        if c == len(ls):
            d += 1
        
print(d)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
count = 1
max = 0
for i in range(n-1):
    if a[i] >= a[i+1]:
        max = a[i]
    if max <= a[i+1]:
        count += 1
print(count)

Failing test case input:
5
9 4 4 2 4

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
h = list(map(int,input().split()))
count = 0
maxh = 0
for i in h:
    if maxh <= i:
        maxh = i
        count += 1
print(count)
Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int,input().split()))

counter = 1
for i in range(N-1):
    check = True
    for j in range(N-2):
        if(H[j]<=H[i+1]):
            pass
        else:
            check = False
            break
    if(check):
        counter += 1

print(counter)



Failing test case input:
5
4 4 10 2 4

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
def chc(H,now):
    if(now == 0):
        return True
    else:
        for i in range(now):
            if(H[i]>H[now]):
                return False
        return True


N = int(input())
H = list(map(int,input().split()))

counter = 0
for i in range(N):
    if(chc(H,i)):
        counter += 1

print(counter)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=list(map(int,input().split()))
c=1
sm=s[0]
for i in range(n-1):
  if sm < s[i+1]:
    sm = s[i+1]
    c += 1
print(c)

Failing test case input:
5
1 5 3 2 5

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
s=list(map(int,input().split()))
c=1
sm=s[0]
for i in range(n-1):
  if sm <= s[i+1]:
    sm = s[i+1]
    c += 1
print(c)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
h=list(map(int,input().split()))
a=1

for i in range(1,n):
    print(h[i])
    print('----------')
    for j in range(i):
        print(h[j])
        print('---')
        if h[i]<h[j]:break
        elif j==i-1:
            a+=1

print(a)

Failing test case input:
5
3 4 4 1 0

Expected output:
3


Actual output:
4
----------
3
---
4
----------
3
---
4
---
1
----------
3
---
0
----------
3
---
3


Fixed submission (verdict: Accepted):
n=int(input())
h=list(map(int,input().split()))
a=1

for i in range(1,n):
    for j in range(i):
        if h[i]<h[j]:break
        elif j==i-1:
            a+=1

print(a)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
cnt = 1
m = H[0]
for i in range(1, N):
    if m <= H[i]:
        cnt += 1
    else:
        m = max(H[0],H[i])
print(cnt)

Failing test case input:
5
0 8 2 6 1

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
cnt = 1
m = H[0]
for i in range(1, N):
    if m <= H[i] and H[i-1] <= H[i]:
        cnt += 1
        m = max(H[0], H[i])

print(cnt)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = [int(x) for x in input().split()]
max_h = l[0]
result = 1
for i in range(1,n):
    print(max_h, l[i])
    if max_h <= l[i]:
        result += 1
        max_h = l[i]
    else:
        continue
print(result)

Failing test case input:
5
1 5 3 4 8

Expected output:
3


Actual output:
1 5
5 3
5 4
5 8
3


Fixed submission (verdict: Accepted):
n = int(input())
l = [int(x) for x in input().split()]
max_h = l[0]
result = 1
for i in range(1,n):
    if max_h <= l[i]:
        result += 1
        max_h = l[i]
    else:
        continue
print(result)
Problem: p03072
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


num = int(input())
str = input().split()
table = [int(i) for i in str]
count = 1
pointed = table[0]
for i in range(1, num):
    if table[0] <= table[i] and table[i-1] <= table[i] :
        count += 1
print(count)


Failing test case input:
5
1 5 3 4 8

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):


num = int(input())
str = input().split()
table = [int(i) for i in str]
count = 1
maxi = table[0]
pointed = table[0]
for i in range(1, num):
    if maxi <= table[i]:
        maxi = table[i]
        count += 1
print(count)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
c=0
H = list(map(int,input().split()))
big=H[0]
for i in range(N):
  if H[i]>=big:
    c=c+1
print(c)

Failing test case input:
5
4 4 10 2 4

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N=int(input())
c=0
H = list(map(int,input().split()))
big=H[0]
for i in range(N):
  if H[i]>=big:
    c=c+1
    if H[i]>big:
      big=H[i]
print(c)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
count = 0
data = [int(s) for s in input().split()]
for i in range(0,n-1):
    max = data[0]
    if data[i] <= data[i+1] and data[i+1] >= max:
        count += 1


print(count+1)

    
    

Failing test case input:
5
1 5 3 4 8

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
count = 0
data = [int(s) for s in input().split()]
max = data[0]
for i in range(0,n-1):
    
    if max < data[i]:
      max = data[i]
    if data[i] <= data[i+1] and data[i+1] >= max:
        count += 1


print(count+1)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
ans = 0
max = H[0]
for i in range(N-1):
  if H[i] >= max:
    ans += 1
    max = H[i]
print(ans+1)


Failing test case input:
4
34 0 -1 4

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
ans = 0
max = H[0]
for i in range(N-1):
  if H[i+1] >= max:
    ans += 1
    max = H[i+1]
print(ans+1)

Problem: p03072
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = sorted([int(x) for x in input().split()])

ans = 0
b = 0
for i in range(N):
    if H[i] >= b:
        ans += 1
        b = H[i]
print(ans)

Failing test case input:
5
4 4 3 0 2

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))

ans = 0
b = 0
for i in range(N):
    if H[i] >= b:
        ans += 1
        b = H[i]

print(ans)
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

def calc(n):
    ans = [0 for i in range(n+1)]
    for x in range(1,n+1):
        a = x**2
        if a>=n:
            break
        for y in range(1,1+n):
            b = y**2
            if b>=n:
                break
            for z in range(1,1+n):
                c = z**2
                if c>=n:
                    break
                f = a+b+c+x*y+y*z+z*x
                if f>n:
                    break
                ans[f]+=1
    return ans

res = calc(N)
for i in range(N+1):
    print(res[i])

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Fixed submission (verdict: Accepted):
N = int(input())

def calc(n):
    ans = [0 for i in range(n+1)]
    for x in range(1,n+1):
        a = x**2
        if a>=n:
            break
        for y in range(1,1+n):
            b = y**2
            if b>=n:
                break
            for z in range(1,1+n):
                c = z**2
                if c>=n:
                    break
                f = a+b+c+x*y+y*z+z*x
                if f>n:
                    break
                ans[f]+=1
    return ans

res = calc(N)
for i in range(N):
    print(res[i+1])
Problem: p02608
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
from math import sqrt
l = [-1]+[0]*10**4
n = int(input())
for i in range(1,int(sqrt(n))+2):
    for j in range(1,int(sqrt(n))+2):
        for k in range(1,int(sqrt(n))+2):
            ans = i**2+j**2+k**2+i*j+j*k+k*i
            if ans <= 10*4:
                l[ans] += 1
for i in range(1,n+1):
    print(l[i])

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0


Fixed submission (verdict: Accepted):
from math import sqrt
l = [-1]+[0]*10**4
n = int(input())
for i in range(1,int(sqrt(n))+2):
    for j in range(1,int(sqrt(n))+2):
        for k in range(1,int(sqrt(n))+2):
            ans = i**2+j**2+k**2+i*j+j*k+k*i
            if ans <= 10**4:
                l[ans] += 1
for i in range(1,n+1):
    print(l[i])
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
A=[0]*n
for i in range(3,int(n**0.5+150)):
  for j in range(1,i-1):
    for k in range(1,i-j):
      if (x:=i*i-j*k-k*(l:=i-j-k)-l*j)<=n:
        A[x-1]+=1
print(A[-30:-1])

Failing test case input:
743

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0
6
0
12
0
9
6
0
3
12
3
6
6
12
6
6
0
0
0
15
3
18
3
18
3
12
6
3
6
9
0
12
0
12
0
18
12
0
0
12
3
6
0
6
6
9
6
0
0
18
1
18
3
12
6
6
6
12
0
15
6
12
6
18
0
0
6
0
9
12
0
18
0
6
3
12
0
12
12
0
0
12
0
3
6
12
6
18
9
18
0
9
6
18
0
6
0
6
3
27
6
6
6
6
3
6
0
12
6
9
0
6
0
18
0
9
9
15
3
12
6
6
3
9
6
12
12
18
0
18
0
6
6
21
6
0
0
6
3
15
6
12
6
18
0
0
0
12
6
6
3
6
4
18
6
12
6
3
9
30
0
18
0
6
6
12
6
6
9
12
0
18
6
18
0
6
0
12
0
6
12
6
3
18
0
6
6
6
6
15
3
24
0
6
3
18
0
12
6
12
6
24
0
15
18
9
6
0
0
18
3
6
0
15
12
12
6
6
0
18
0
6
3
12
0
12
6
6
9
9
6
24
3
24
0
9
12
6
6
12
0
12
0
21
9
15
6
12
3
18
3
12
6
12
6
0
0
12
0
12
6
24
0
6
12
6
1
9
6
12
6
24
0
18
3
12
6
6
12
24
0
12
6
15
6
18
0
18
0
0
0
18
9
21
12
0
6
18
0
9
6
6
6
12
0
12
0
9
9
27
6
6
3
18
6
21
6
6
12
12
0
12
0
24
12
0
0
24
3
24
6
12
12
18
0
0
0
12
0
18
3
15
6
12
9
6
0
15
6
9
12
24
0
12
3
6
6
21
6
18
3
18
0
21
12
15
6
6
0
12
3
12
9
18
9
12
6
6
6
24
0
18
3
24
0
6
6
0
6
9
6
6
4
30
0
18
12
9
6
24
0
18
0
9
12
21
6
6
12
12


Actual output:
[0, 18, 3, 24, 0, 6, 6, 0, 6, 9, 6, 6, 4, 30, 0, 18, 12, 9, 6, 24, 0, 18, 0, 9, 12, 21, 6, 6, 12]


Fixed submission (verdict: Accepted):
n=int(input())
A=[0]*n
for i in range(3,int(n**0.5+150)):
  for j in range(1,i-1):
    for k in range(1,i-j):
      if (x:=i*i-j*k-k*(l:=i-j-k)-l*j)<=n:
        A[x-1]+=1
for a in A:
  print(a)
Problem: p02608
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
n=int(input())
z=0
d=0
ans=0
for i in range(1,n+1):
  for x in range(1,int(math.sqrt(n))):
    d=4*x*x-4*(3*x*x-i)
    if d<0:
      continue
    z=(math.sqrt(d)-2*x)/2
    if z.is_integer():
      if x==int(z) and z>=1:
        ans+=1
        continue
      elif z>=1:
        ans+=3
        continue
    else:
      continue
    z=0
  print(ans)
  ans=0

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
0
0
3
0
0
0
0
0
3
3
0
0
0
3
0
0
0
0
3
3
0
0
0
0
0
0
3
0
0
1
0
0
6
0
0
0
0
0
0
0
0
3
3
3
0
0
0
3
0
0
0
0
0
0
0
0
3
3
3
0
0
3
0
0
3
0
0
0
0
0
0
1
0
0
6
0
0
3
0
0
0
0
0
3
0
0
0
0
3
3
0
0
0
3
0
0
3
0
3
0
0
0
0
0
3
0
3
3
0
0
0
3
0
0
3
0
0
0
0
0
0
3
0
0
0
1
0
3
6
0
0
0
0
0
0
0
0
6
0
0
0
0
0
0
0
0
6
3
0
0
0
3
3
0
3
0
0
0
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
6
0
0
3
0
0
3
0
0
0
0
3
0
0
0
0
3
0
1
0
0
6
0
0
0
0
0
0
0
3
6
0
0
0
0
3
0
0
0
0
0
0
0
3
3
3
0
0
3
0
0
3
0
0
0
0
0
0
0
3
3
0
0
0
3
0
3
0
0
3
3
0
0
0
3
0
3
3
0
0
0
0
0
0
0
3
0
0
0
0
3
0
0
3
0
0
1
0
0
9
0
0
0
0
0
0
0
0
6
3
0
0
0
0
0
0
0
0
0
0
0
0
0
6
0
3
3
0
3
0
3
0
0
3
3
0
0


Fixed submission (verdict: Accepted):
import math
n=int(input())
z=0
d=0
ans=0
for i in range(1,n+1):
  for x in range(1,int(math.sqrt(n)+1)):
    for y in range(1,int(math.sqrt(n)+1)):
      d=x*x+y*y+2*x*y-4*(x*x+y*y+x*y-i)
      if d<0:
        continue
      z=(math.sqrt(d)-(x+y))/2
      if z.is_integer() and z>=1:
        ans+=1
      else:
        continue
  print(ans)
  ans=0
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
N_list = [0]*(N+1)

for i in range(1,11):
    for j in range(1,11):
        for k in range(1,11):
           if(i**2+j**2+k**2+i*j+j*k+k*i<=N):
               N_list[i**2+j**2+k**2+i*j+j*k+k*i]+=1
for i in N_list:
    print(i)

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
0
6
0
0
1
6
3
12
6
0
0
12
0
6
0
0
6
12
0
0
6
0
0
6
0
9
3
6
0
6
3
6
0
3
6
6
0
6
0
6
0
9
6
0
0
6
0
3
3
6
0
6
3
6
0
3
6
6
0
6
0
6
0
9
6
0
0
6
0
0
1
6
0
6
6
0
0
12
0
6
0
0
6
12
0
0
6
0
0
6
0
6
0
0
0
3
3
6
0
6
3
6
0
3
6
6
0
6
0
6
0
6
0
0
0
0
3
6
0
0
0
3
3
6
0
6
3
6
0
3
6
6
0
6
0
0
0
3
6
0
0
0
0
0
0
6
0
0
1
6
0
6
6
0
0
12
0
6
0
0
3
6
0
0
0
0
0
6
0
0
0
0
0
0
0
3
0
3
3
6
0
6
3
6
0
3
6
0
0


Fixed submission (verdict: Accepted):
N = int(input())
N_list = [0]*(N+1)

for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
           if(i**2+j**2+k**2+i*j+j*k+k*i<=N):
               N_list[i**2+j**2+k**2+i*j+j*k+k*i]+=1
for i in N_list[1:]:
    print(i)
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import defaultdict
n = int(input())

res = defaultdict(int)
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            v = i*i + j*j + k*k + i*j + j*k + k*i
            res[v] += 1

for i in range(n):
    print(res.get(i, 0))


Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18


Fixed submission (verdict: Accepted):
from collections import defaultdict
n = int(input())

res = defaultdict(int)
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            v = i*i + j*j + k*k + i*j + j*k + k*i
            res[v] += 1

for i in range(1, n + 1):
    print(res.get(i, 0))