Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = ["."+input()+"." for i in range(h)]
s = ["."*w] + s + ["."*w]

for i in range(1,h+1):
  for j in range(1,w+1):
    if s[i][j] == "#":
      if s[i][j+1] == s[i][j-1] == s[i+1][j] == s[i-1][j] == ".":
        print("No")
        exit()

print("Yes")

Fixed submission:
h, w = map(int, input().split())
s = [input() for i in range(h)]
flag = True

for i in range(h):
  for j in range(w):
    if s[i][j] == "#":
      top = max(0, i-1)
      bottom = min(h-1, i+1)
      right = min(w-1, j+1)
      left = max(0, j-1)
      if s[i][right] != "#" and s[i][left] != "#" and s[top][j] != "#" and s[bottom][j] != "#":
        flag = False
        break
  if flag == False:
    break

if flag:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = [["."]+input()+["."] for i in range(h)]
s = ["."*w] + s + ["."*w]

for i in range(1,h+1):
  for j in range(1,w+1):
    if s[i][j] == "#":
      if s[i][j+1] == s[i][j-1] == s[i+1][j] == s[i-1][j] == ".":
        print("No")
        exit()

print("Yes")

Fixed submission:
h, w = map(int, input().split())
s = [input() for i in range(h)]
flag = True

for i in range(h):
  for j in range(w):
    if s[i][j] == "#":
      top = max(0, i-1)
      bottom = min(h-1, i+1)
      right = min(w-1, j+1)
      left = max(0, j-1)
      if s[i][right] != "#" and s[i][left] != "#" and s[top][j] != "#" and s[bottom][j] != "#":
        flag = False
        break
  if flag == False:
    break

if flag:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = 0
for i in range(1,10):
  for j in range(0,10):
    for k in range(0,10):
  x = 10000*i + 1000*j + 100*k + 10*j + i
  if a <= x <= b:
    ans += 1
print(ans)

Fixed submission:
a, b = map(int, input().split())
ans = 0
import itertools
for i,j,k in itertools.product(range(0,10), repeat=3):
  if i == 0:
    continue
  x = 10000*i + 1000*j + 100*k + 10*j + i
  if a <= x <= b:
    ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = 0
for i in range(1,10):
  for j in range(0,10):
    for k in range(0.10):
  x = 10000*i + 1000*j + 100*k + 10*j + i
  if a <= x <= b:
    ans += 1
print(ans)

Fixed submission:
a, b = map(int, input().split())
ans = 0
import itertools
for i,j,k in itertools.product(range(0,10), repeat=3):
  if i == 0:
    continue
  x = 10000*i + 1000*j + 100*k + 10*j + i
  if a <= x <= b:
    ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in set(a):
  c = a.count(i)
  if c >= i:
    ans += i
print(n - ans)

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

ans = 0
for i in set(a):
  if i <= n:
    c = a.count(i)
    if c >= i:
      ans += i
print(n - ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in set(a):
  c = a.count(i)
  if c >= i:
    ans += c - i
  else:
    ans += c
print(ans)

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

ans = 0
for i in set(a):
  if i <= n:
    c = a.count(i)
    if c >= i:
      ans += i
print(n - ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
fx = sum([int(i) for i in list(n)])
if n % fx == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
n = int(input())
fx = sum([int(i) for i in list(str(n))])
if n % fx == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
def f(i):
  if i >= 2:
    li = f(i-1) + f(i-2)
  elif i == 1:
    li = 1
  elif i == 0:
    li = 2
  return li

print(f(n))

Fixed submission:
n = int(input())
l = [2, 1]
if n == 1:
  print(1)
else:
  for i in range(2, n+1):
    l.append(l[i-1] + l[i-2])
  print(l[n])
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = ["a"*(w+2)] + ["a" + input() + "a" for i in range(h)] + ["a"*(w+2)]

for i in range(1, h+1):
  for j in range(1, w+1):
    if s[i][j] != "#":
      c = [s[i-1][j-1], s[i-1][j], s[i-1][j+1], s[i][j-1], s[i][j+1], s[i+1][j-1], s[i+1][j], s[i+1][j+1]]
      s[i][j] = str(c.count("#"))
      
for i in s:
  print(i)

Fixed submission:
h, w = map(int, input().split())
s = ["a"*(w+2)] + ["a" + input() + "a" for i in range(h)] + ["a"*(w+2)]

ans = []
for i in range(1, h+1):
  for j in range(1, w+1):
    if s[i][j] == "#":
      ans.append("#")
    else:
      c = [s[i-1][j-1], s[i-1][j], s[i-1][j+1], s[i][j-1], s[i][j+1], s[i+1][j-1], s[i+1][j], s[i+1][j+1]]
      ans.append(c.count("#"))
      
for i in range(h):
  print("".join(list(map(str, ans[i*w:(i+1)*w]))))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
n = max(A)
dp = [True for i in range(n+1)]
p = 2
while (p * p <= n): 
  # If prime[p] is not changed, then it is a prime 
  if (prime[p] == True): 
    # Update all multiples of p 
    for i in range(p * p, n+1, p): 
      prime[i] = False
      p += 1
ans = 0
for num in A:
  if dp[num]:
    ans += 1
print(ans)

Fixed submission:
from collections import Counter
def D():
    N = int(input())
    A = list(map(int, input().split()))
    nums = Counter(A)
    if 1 in nums:
        if nums[1] > 1:
            print(0)
            return
        else:
            print(1)
            return
    n = max(A)
    dp = [True for i in range(n+1)]
    p = 2
    while (p <= n): 
        if (p in nums and dp[p] == True): 
            for i in range(p*2, n+1, p): 
                # print(i)
                dp[i] = False
        p += 1
    ans = 0
    for num in nums:
        if nums[num] == 1 and dp[num]:
            # print(num)
            ans += 1
    print(ans)

D()
Buggy python submission (verdict: Time Limit Exceeded):
def B():
    N = int(input())
    A = map(int, input().split())
    ans = 1
    limit = 10**18
    for a in A:
        ans *= a
    if ans > limit:
        print(-1)
        return
    print(ans)
B()

Fixed submission:
def B():
    N = int(input())
    A = list(map(int, input().split()))
    if 0 in A:
        print(0)
        return
    ans = 1
    limit = 10**18
    for a in A:
        ans *= a
        if ans > limit:
            print(-1)
            return
    print(ans)
B()
Buggy python submission (verdict: Time Limit Exceeded):
def E():
    N = int(input())
    A = [int(n) for n in input().split()]
    count = 0
    for i in range(len(A)):
        for j in range(i+1, len(A)):
            if A[j]+A[i] == abs(j-i):
                count += 1
    print(count)

E()

Fixed submission:
from collections import defaultdict
def E():
    N = int(input())
    A = [int(n) for n in input().split()]
    record = defaultdict(int)
    count = 0
    for i in range(len(A)):
        cur = i-A[i]
        count += record[cur]
        record[i+A[i]] += 1
    
    print(count)

E()
Buggy python submission (verdict: Runtime Error):
import heapq
def E():
    X, Y, A, B, C = map(int, input().split())
    reds = []
    heapq.heapify(reds)
    for n in input().split():
        heapq.heappush(reds, int(n))
    greens = []
    heapq.heapify(greens)
    for n in input().split():
        heapq.heappush(greens, int(n))
    colorless = []
    heapq.heapify(colorless)
    for n in input().split():
        heapq.heappush(colorless, -int(n))
    
    redx = heapq.nlargest(X, reds)
    greeny = heapq.nlargest(Y, greens)
    colorless_val = 0
    while True:
        if not colorless:
            break
        cur = abs(heapq.heappop(colorless))
        if cur > redx[-1]:
            if redx[-1] > greeny[-1]:
                greeny.pop()
            else:
                redx.pop()
            colorless_val += cur
        elif cur > greeny[-1]:
            if greeny[-1] > redx[-1]:
                redx.pop()
            else:
                greeny.pop()
            colorless_val += cur
        else:
            break
    print(sum(redx)+sum(greeny)+colorless_val)

E()

Fixed submission:
import heapq
def E():
    X, Y, A, B, C = map(int, input().split())
    reds = []
    heapq.heapify(reds)
    for n in input().split():
        heapq.heappush(reds, int(n))
    greens = []
    heapq.heapify(greens)
    for n in input().split():
        heapq.heappush(greens, int(n))
    colorless = []
    heapq.heapify(colorless)
    for n in input().split():
        heapq.heappush(colorless, -int(n))
    
    redx = heapq.nlargest(X, reds)
    greeny = heapq.nlargest(Y, greens)
    colorless_val = 0
    while True:
        if not colorless:
            break
        cur = abs(heapq.heappop(colorless))
        if redx and cur > redx[-1]:
            if greeny and redx[-1] > greeny[-1]:
                greeny.pop()
            else:
                redx.pop()
            colorless_val += cur
        elif greeny and cur > greeny[-1]:
            if redx and greeny[-1] > redx[-1]:
                redx.pop()
            else:
                greeny.pop()
            colorless_val += cur
        else:
            break
    print(sum(redx)+sum(greeny)+colorless_val)

E()
Buggy python submission (verdict: Time Limit Exceeded):
import heapq
def A():
    H, W = map(int, input().split())
    maze = []
    for i in range(H):
        maze.append(input())
    if maze[0][0] == '.':
        q = [[0, (0, 0)]]
    else:
        q = [[1, (0, 0)]]
    heapq.heapify(q)
    while q:
        #print(q)
        cost, cur = heapq.heappop(q)
        if cur[0] == H-1 and cur[1] == W-1:
            print(cost)
            return
        for direction in [(0, 1), (1, 0)]:
            new_r, new_c = cur[0]+direction[0], cur[1]+direction[1]
            if new_r >= 0 and new_c >= 0 and new_r < H and new_c < W:
                if maze[new_r][new_c]=='.':
                    heapq.heappush(q, [cost, (new_r, new_c)])
                else:
                    heapq.heappush(q, [cost+1, (new_r, new_c)])

A()

Fixed submission:
import heapq
def A():
    H, W = map(int, input().split())
    maze = []
    for i in range(H):
        maze.append(input())
    # if maze[0][0] == '.':
    #     q = [[0, (0, 0)]]
    # else:
    #     q = [[1, (0, 0)]]
    # heapq.heapify(q)
    # while q:
    #     #print(q)
    #     cost, cur = heapq.heappop(q)
    #     if cur[0] == H-1 and cur[1] == W-1:
    #         print(cost)
    #         return
    #     for direction in [(0, 1), (1, 0)]:
    #         new_r, new_c = cur[0]+direction[0], cur[1]+direction[1]
    #         if new_r >= 0 and new_c >= 0 and new_r < H and new_c < W:
    #             if maze[new_r][new_c]=='.':
    #                 heapq.heappush(q, [cost, (new_r, new_c)])
    #             else:
    #                 heapq.heappush(q, [cost+1, (new_r, new_c)])
    memo = [[float('inf') for i in range(W)] for j in range(H)]
    # if maze[H-1][W-1] == '.':
    #     memo[H-1][W-1] = 0
    # else:
    #     memo[H-1][W-1] = 1
    # def dfs(r, c, prev_flipped):
    #     if memo[r][c] < float('inf'):
    #         return memo[r][c]
    #     cur_flipped = False
    #     if maze[r][c] == '.':
    #         cur_cost = 0
    #     else:
    #         if prev_flipped:
    #             cur_cost = 0
    #         else:
    #             cur_cost = 1
    #         cur_flipped = True
    #     minimum_next = float('inf')
    #     if r+1 < H:
    #         minimum_next = dfs(r+1, c, cur_flipped)
    #     if c+1 < W:
    #         minimum_next = min(minimum_next, dfs(r, c+1, cur_flipped))
    #     res = cur_cost+minimum_next
    #     memo[r][c] = res
    #     return res
    # print(dfs(0, 0, False))
    if maze[0][0] == '.':
        memo[0][0] = 0
    else:
        memo[0][0] = 1
    for i in range(H):
        for j in range(W):
            for r, c in [(i+1, j), (i, j+1)]:
                if r<H and c<W:
                    if maze[i][j] == '.' and maze[r][c] == '#':
                        temp = 1
                    else:
                        temp = 0
                    memo[r][c] = min(memo[r][c], memo[i][j]+temp)
    print(memo[-1][-1])

A()
Buggy python submission (verdict: Time Limit Exceeded):
def A():
    temp = [int(i) for i in input().split()]
    print(max(0, temp[0]-2*temp[1]))

def B():
    N = int(input())
    T = [int(i) for i in input().split()]
    s = 0
    for i in range(N):
        for j in range(i):
            s += T[i]*T[j]
    print(s)

def C():
    N = int(input())
    S = input()
    if N == 1:
        print(1)
    else:
        ans = 1
        cur_c = S[0]
        for c in S:
            if c != cur_c:
                ans += 1
                cur_c = c
        
        print(ans)

def D():
    N = int(input())
    L = sorted([int(i) for i in input().split()],reverse = True)
    # dp_sum = [[0 for i in range(N)] for j in range(N)]
    # for i in range(N):
    #     for j in range(i):
    #         dp_sum[i][j] = L[i]+L[j]
    count = 0
    for i in range(N):
        for j in range(i):
            for k in range(j):
                if L[k] < L[i]+L[j] and L[j] < L[i]+L[k] and L[i] < L[j]+L[k]:
                    count += 1
    print(count)

D()

Fixed submission:
def A():
    temp = [int(i) for i in input().split()]
    print(max(0, temp[0]-2*temp[1]))

def B():
    N = int(input())
    T = [int(i) for i in input().split()]
    s = 0
    for i in range(N):
        for j in range(i):
            s += T[i]*T[j]
    print(s)

def C():
    N = int(input())
    S = input()
    if N == 1:
        print(1)
    else:
        ans = 1
        cur_c = S[0]
        for c in S:
            if c != cur_c:
                ans += 1
                cur_c = c
        
        print(ans)

from bisect import bisect_left, bisect_right
from itertools import combinations 

def D():
    N = int(input())
    L = sorted([int(i) for i in input().split()])
    count = 0
    for i in range(N):
        s = 0
        e = i-1
        while s<e:
            if L[i] < L[s]+L[e]:
                count += e-s
                e -= 1
            else:
                s += 1

    # dp_sum = [[0 for i in range(N)] for j in range(N)]
    # count = 0
    # for i in range(N):
    #     for j in range(i):
    #         print(L, L[i]+L[j])
    #         print(bisect_left(L, L[i]+L[j])-2, count)
    #         check_idx = bisect_left(L, L[i]+L[j])
    # count = 0
    # for i in range(N):
    #     for j in range(i):
    #         for k in range(j):
    #             if L[k] < L[i]+L[j] and L[j] < L[i]+L[k] and L[i] < L[j]+L[k]:
    #                 count += 1

    print(count)

D()
Buggy python submission (verdict: Time Limit Exceeded):
def D():
    n = int(input())
    S = [i for i in range(1, n+1)]
    ans = 0
    # for i in range(1, n+1):
    #     m = 0
    #     s = [i for i in range(1, n+1)]
    #     for j in range(len(s)):
    #         m = max(m, s[0]%i)
    #         del s[0]

    #     print(i, m)
    #     ans += m
    ans = n*(n-1)//2
    print(ans)
D()

Fixed submission:
def D():
    n = int(input())
    ans = 0
    # for i in range(1, n+1):
    #     m = 0
    #     s = [i for i in range(1, n+1)]
    #     for j in range(len(s)):
    #         m = max(m, s[0]%i)
    #         del s[0]

    #     print(i, m)
    #     ans += m
    ans = n*(n-1)//2
    print(ans)
D()

Buggy python submission (verdict: Time Limit Exceeded):
def D():
    n = int(input())
    ans = 0
    for i in range(1, n+1):
        m = 0
        s = [i for i in range(n)]
        for j in range(len(s)):
            m = max(m, s[0]%i)
            del s[0]

        ans += m
    print(ans)
D()

Fixed submission:
def D():
    n = int(input())
    ans = 0
    # for i in range(1, n+1):
    #     m = 0
    #     s = [i for i in range(1, n+1)]
    #     for j in range(len(s)):
    #         m = max(m, s[0]%i)
    #         del s[0]

    #     print(i, m)
    #     ans += m
    ans = n*(n-1)//2
    print(ans)
D()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**5+10)
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
MOD = 1000000007
memo = {}
def Fib(n, A, MOD):
    if n in A:
        return 0
    elif n == 0:
        return 1
    elif n == 1:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n] = ( Fib(n-1, A, MOD) + Fib(n-2, A, MOD) ) % MOD
        return memo[n]
print(Fib(N, A, MOD))

Fixed submission:
from collections import deque
def C():
    N, M = map(int, input().split())
    A = set([int(input()) for _ in range(M)])
    dp = deque([1, 1 if 1 not in A else 0])
    MOD = 1000000007
    for i in range(2,N+1):
        #print(i, dp)
        if i in A:
            dp.append(0)
        else:
            dp.append((dp[0]+dp[1]) % MOD)
        dp.popleft()
    print(dp[-1])

C()

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**5)
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
MOD = 1000000007
def Fib(n, A, MOD, memo={}):
    if n in A:
        return 0
    elif n == 0:
        return 1
    elif n == 1:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n] = ( Fib(n-1, A, MOD, memo) + Fib(n-2, A, MOD, memo) ) % MOD
        return memo[n]
print(Fib(N, A, MOD))

Fixed submission:
from collections import deque
def C():
    N, M = map(int, input().split())
    A = set([int(input()) for _ in range(M)])
    dp = deque([1, 1 if 1 not in A else 0])
    MOD = 1000000007
    for i in range(2,N+1):
        #print(i, dp)
        if i in A:
            dp.append(0)
        else:
            dp.append((dp[0]+dp[1]) % MOD)
        dp.popleft()
    print(dp[-1])

C()

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**10)
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
MOD = 1000000007
def Fib(n, A, MOD, memo={}):
    if n in A:
        return 0
    elif n == 0:
        return 1
    elif n == 1:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n] = ( Fib(n-1, A, MOD, memo) + Fib(n-2, A, MOD, memo) ) % MOD
        return memo[n]
print(Fib(N, A, MOD))

Fixed submission:
from collections import deque
def C():
    N, M = map(int, input().split())
    A = set([int(input()) for _ in range(M)])
    dp = deque([1, 1 if 1 not in A else 0])
    MOD = 1000000007
    for i in range(2,N+1):
        #print(i, dp)
        if i in A:
            dp.append(0)
        else:
            dp.append((dp[0]+dp[1]) % MOD)
        dp.popleft()
    print(dp[-1])

C()
Buggy python submission (verdict: Runtime Error):
n = int(intput())
str = input()
print(str.count('ABC'))

Fixed submission:
n = int(input())

s = input()

print(s.count('ABC'))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

def ans() :
    n, m  = map(int, input().split())
    a = list(map(int, input().split()))

    for i in range(m):
        j = a.index(max(a))
        a[j] = a[j] >> 1

    print(sum(a))

if __name__ == '__main__':
    ans()

Fixed submission:
# -*- coding: utf-8 -*-

import heapq

def ans() :
    n, m  = map(int, input().split())
    aa = map(int, input().split())
    a = []
    for i in aa:
        heapq.heappush(a, int(i) * (-1))

    for i in range(m):
        head = heapq.heappop(a)
        head = (-1) * (-head // 2)
        heapq.heappush(a, head)

    print(-sum(a))

if __name__ == '__main__':
    ans()

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

def ans() :
    n, m  = map(int, input().split())
    a = list(map(int, input().split()))

    for i in range(m):
        a[a.index(max(a))] = a[a.index((max(a)))] >> 1

    print(sum(a))

if __name__ == '__main__':
    ans()

Fixed submission:
# -*- coding: utf-8 -*-

import heapq

def ans() :
    n, m  = map(int, input().split())
    aa = map(int, input().split())
    a = []
    for i in aa:
        heapq.heappush(a, int(i) * (-1))

    for i in range(m):
        head = heapq.heappop(a)
        head = (-1) * (-head // 2)
        heapq.heappush(a, head)

    print(-sum(a))

if __name__ == '__main__':
    ans()

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

def ans() :
    n, m  = map(int, input().split())
    a = list(map(int, input().split()))

    for i in range(m):
        a[a.index(max(a))] = a[a.index((max(a)))] >> 1

    print(sum(a))

if __name__ == '__main__':
    ans()

Fixed submission:
# -*- coding: utf-8 -*-

import heapq

def ans() :
    n, m  = map(int, input().split())
    aa = map(int, input().split())
    a = []
    for i in aa:
        heapq.heappush(a, int(i) * (-1))

    for i in range(m):
        head = heapq.heappop(a)
        head = (-1) * (-head // 2)
        heapq.heappush(a, head)

    print(-sum(a))

if __name__ == '__main__':
    ans()

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

def ans() :
    n, m  = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()

    for i in range(m):
        a[-1] = a[-1] >> 1
        a.sort()

    print(sum(a))

if __name__ == '__main__':
    ans()

Fixed submission:
# -*- coding: utf-8 -*-

import heapq

def ans() :
    n, m  = map(int, input().split())
    aa = map(int, input().split())
    a = []
    for i in aa:
        heapq.heappush(a, int(i) * (-1))

    for i in range(m):
        head = heapq.heappop(a)
        head = (-1) * (-head // 2)
        heapq.heappush(a, head)

    print(-sum(a))

if __name__ == '__main__':
    ans()
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

int main(int argc, char const* argv[])
{
	string s;
	cin >> s;
	
	deque<char> q;
	rep(i, s.length()){
		if(s[i] == 'B' && !q.empty()){
			q.pop_back();
		} else if(s[i] != 'B'){
			q.push_back(s[i]);
		}
	}
	
	rep(i, q.size()){
		cout << q[i];
	}
	
	cout << endl;
	return 0;
}


Fixed submission:
a = input()
ans = ""
for i in a:
    if i == "0" or i == "1":
        ans += i
    
    elif len(ans) > 0 :
        ans = ans[:len(ans)-1]

print(ans)
Buggy python submission (verdict: Runtime Error):
from itertools import combinations
n = int(input())
l = list(map(int,input().split()))
c = combinations(l,3)
ans=0
for (a,b,c) in c:
	if a+b>c and b+c>a and c+a>b and a!=b and b!=c and a!=c:
		+=1
print(ans)


Fixed submission:
from itertools import combinations
n = int(input())
l = list(map(int,input().split()))
c = combinations(l,3)
ans=0
for (a,b,c) in c:
  if a+b>c and b+c>a and c+a>b and a!=b and b!=c and a!=c:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
k = int(input())
t = 7
ans=0
for i in range(k):
  if t%k==0:
    ans=i+1
  	break
  else:
    t = (t*10+7)%k
        
if ans >0:
  print(ans) 
else:
  print(-1)

Fixed submission:
k = int(input())
t = 7
ans=0
for i in range(k):
    if t%k==0:
        ans=i+1
        break
    else:
        t = (t*10+7)%k
        
if ans >0:
    print(ans) 
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
from sys import stdin, stdout
read = stdin.readline
write = stdout.write
flush = stdout.flush
xr = xrange

def main():
	c = read().strip()
	if ord(c) - ord('A') <= 26: write('A\n')
	else: write('a\n')

if __name__ == "__main__":
	main()

Fixed submission:
from sys import stdin, stdout
read = stdin.readline
write = stdout.write
flush = stdout.flush
xr = xrange

def main():
	c = read().strip()
	if ord(c) - ord('A') <= 26: write('A\n')
	else: write('a\n')

if __name__ == "__main__":
	main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]
prod = 1
a.sort()
for i in range(n):
	if a[i] == 0:
		prod = 0
		break
	else:
		prod *= a[i]
if prod > int(1e18):
	print(-1)
else:
	print (prod)

Fixed submission:
N = input()
A = list(map(int, input().split()))

k = 1
if 0 in A:
	print(0)
else:
	for i in A:
		k = k * i
		if k > 10 ** 18:
			print(-1)
			break
	if k <= 10 ** 18:
		print(k)
Buggy python submission (verdict: Runtime Error):
a, b: int = map(int, input().split())

print(a * b)


Fixed submission:
a, b = map(int, input().split())

print(a * b)
Buggy python submission (verdict: Runtime Error):
n=input()
print(n+n**2+n**3)

Fixed submission:
n=int(input())
print(n+n**2+n**3)