Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02921 (python)

Fixed submission:
S = input()
T = input()

count = 0
for i in range(3):
    if S[i] == T[i]:
        count =count + 1
print(count)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

count = 0
for i in range(1000):
    if S[i] == T[i]:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

count = 0
for i in range(1000):
    if S[i] == T[i]:
        cnt += 1
print(count)
Problem p02923 (python)

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

a = 0
b = 0
res = 0
while a < A:
    if a < A - 1 and B[a + 1] <= B[a]:
        a += 1
        res = max(res, a - b)
    elif a != b:
        b += 1
    else:
        b += 1
        a += 1
print(res)

Buggy submission (verdict: Runtime Error):
#El Patron
A = int(input())
B = list(map(int, input().split()))

a = 0
b = 0
ans = 0
while b < A:
    if b < A - 1 and B[b + 1] <= B[b]:
        b += 1
        res = max(res, b - l)
    elif b != a:
        a += 1
    else:
        a += 1
        b += 1
print(res)

Buggy submission (verdict: Runtime Error):
#El Patron
A = int(input())
B = list(map(int, input().split()))

a = 0
b = 0
ans = 0
while b < A:
    if b < A - 1 and B[b + 1] <= B[b]:
        b += 1
        res = max(res, b - l)
    elif b != l:
        a += 1
    else:
        a += 1
        b += 1
print(res)
Problem p02939 (python)

Fixed submission:
S = list(input())

pre_list = []
tar_list = [S[0]]
count = 1
i = 1
try:
	while i < len(S):
		pre_list = tar_list 
		tar_list = []
		tar_list.append(S[i])
		i += 1
		
		while tar_list == pre_list:
			tar_list.append(S[i])
			i += 1
	
		count += 1

except IndexError:
	pass
print(count)

Buggy submission (verdict: Runtime Error):
#El Patron
S = list(input())

pre_list = []
tar_list = [S[0]]
count = 1
a = 1
try:
	while a < len(S):
		pre_list = tar_list 
		tar_list = []
		tar_list.append(S[i])
		a += 1
	
		while tar_list == pre_list:
			tar_list.append(S[i])
			a += 1
	
		count += 1

except IndexError:
	pass
print(count)

Buggy submission (verdict: Runtime Error):
#El Patron
S = list(input())

pre_list = []
tar_list = [S[0]]
count = 1
a = 1
try:
	while a < len(S):
		pre_list = tar_list 
		tar_list = []
		tar_list.append(S[i])
		a += 1
	
		while tar_list == pre_list:
			tar_list.append(S[i])
			a += 1
	
		count += 1

except IndexError:
	pass
print(count)
Problem p02768 (python)

Fixed submission:
N,A,B = map(int,input().split())
mod = 10**9+7
X = 210000
inv_t = [0]+[1]
for i in range(2,X):
  inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]

def fast_mod_pow(x, n, mod):
    r = 1
    while n>0:
        if n&1:
            r = (r * x) % mod
        x = (x * x) % mod
        n >>= 1
    return r

def comb(n,k):
    value = 1
    for i in range(n-k+1,n+1):
        value *= i
        value %= mod
    for i in range(1,k+1):
        value *= inv_t[i]
        value %= mod
    return value

ans = fast_mod_pow(2,N,mod)-1
ans -= comb(N,A)
ans -= comb(N,B)
print(ans%mod)

Buggy submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
mod = 10**9+7
X = 200000
inv_t = [0]+[1]
for i in range(2,X):
  inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]

def fast_mod_pow(x, n, mod):
    r = 1
    while n>0:
        if n&1:
            r = (r * x) % mod
        x = (x * x) % mod
        n >>= 1
    return r

def comb(n,k):
    value = 1
    for i in range(n-k+1,n+1):
        value *= i
        value %= mod
    for i in range(1,k+1):
        value *= inv_t[i]
        value %= mod
    return value

ans = fast_mod_pow(2,N,mod)-1
ans -= comb(N,A)
ans -= comb(N,B)
print(ans%mod)
Problem p02789 (python)

Fixed submission:
N,M = map(int,input().split())
if N == M:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N,M = map(int,input())
if N == M:
    print('Yes')
else:
    print('No')
Problem p02913 (python)

Fixed submission:
n = int(input())
s = input()
def output():
    left, right = 0, n//2+1
    while left < right-1:
        mid = (left+right)//2
        if check(mid):
            left = mid
        else:
            right = mid
    return left
def check(x):
    hashes = set()
    for i in range(n - 2*x + 1):
        hashes.add(s[i: i+x])
        if s[i+x: i+2*x] in hashes:
            return True
    return False
print(output())

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
S = input()

def z_arr(s):
    Z = [0] * len(s)
    Z[0] = len(s)

    rt = 0
    lt = 0

    for k in range(1, len(s)):
        if k > rt:
            # If k is outside the current Z-box, do naive computation.
            n = 0
            while n + k < len(s) and s[n] == s[n+k]:
                n += 1
            Z[k] = n
            if n > 0:
                lt = k
                rt = k+n-1
        else:
            # If k is inside the current Z-box, consider two cases.

            p = k - lt  # Pair index.
            right_part_len = rt - k + 1

            if Z[p] < right_part_len:
                Z[k] = Z[p]
            else:
                i = rt + 1
                while i < len(s) and s[i] == s[i - k]:
                    i += 1
                Z[k] = i - k

                lt = k
                rt = i - 1
    return Z

ans = 0
for i in range(len(S)):
    x = z_arr(S[i:])
    for j,e in enumerate(x):
        remain_length = len(S[i:])-e
        if remain_length >= e:
            if e > ans:
                ans = e

print(ans)
Problem p02923 (python)

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


count = 0
counts = []
max_count = 0
for i in reversed(range(1,N)):
    if Hs[i-1] >= Hs[i]:
        count += 1
    else:
        if max_count < count:
            max_count = count
        count = 0
if count > max_count:
    print(count)
else:
    print(max_count)

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


count = 0
counts = []
for i in reversed(range(1,N)):
    if Hs[i-1] >= Hs[i]:
        count += 1
    else:
        counts.append(count)
        count = 0

print(max(counts))
Problem p02927 (python)

Fixed submission:
import math
import sys
import numpy as np
from collections import defaultdict, deque, Counter 
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)

m, d = map(int,input().split())

count = 0
for i in range(1,m+1):
    for j in range(10,d+1):
        first_d = int(str(j)[1])
        second_d = int(str(j)[0])
        if i == first_d * second_d and first_d >= 2 and second_d >= 2:
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import math
import sys
from copy import copy
import numpy as np
from collections import defaultdict, deque, Counter 
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)

n = int(input())
s = list(input())

count = 0


if s[0] == 'W' or s[-1] == 'W':
    print(0)
    sys.exit()

LR_list = ['' for i in range(2*n)]
LR_list[0] = 'L'

for i in range(1,len(LR_list)):
    if s[i] == s[i-1]:
        if LR_list[i-1] == 'R':
            LR_list[i] = 'L'
        else:
            LR_list[i] = 'R'
    else:
        if LR_list[i-1] == 'R':
            LR_list[i] = 'R'
        else:
            LR_list[i] = 'L'

values = []

if LR_list.count('L') != LR_list.count('R'):
    print(0)
    sys.exit()
for i in range(len(LR_list)):
    if LR_list[i] == 'R':
        li = LR_list[:i].count('L')
        ri = LR_list[:i].count('R')
        values.append(li-ri)
print(np.array(values).prod()*math.factorial(n))
Problem p02929 (python)

Fixed submission:
import math
import sys
from copy import copy
import numpy as np
from collections import defaultdict, deque, Counter 
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)

n = int(input())
s = list(input())

count = 0


if s[0] == 'W' or s[-1] == 'W':
    print(0)
    sys.exit()

LR_list = ['' for i in range(2*n)]
LR_list[0] = 'L'

for i in range(1,len(LR_list)):
    if s[i] == s[i-1]:
        if LR_list[i-1] == 'R':
            LR_list[i] = 'L'
        else:
            LR_list[i] = 'R'
    else:
        if LR_list[i-1] == 'R':
            LR_list[i] = 'R'
        else:
            LR_list[i] = 'L'

values = []

if LR_list.count('L') != LR_list.count('R'):
    print(0)
    sys.exit()


li = 0
ri = 0
for i in range(len(LR_list)):
    if i != 0:
        if LR_list[i-1] == 'L':
            li += 1
        elif LR_list[i-1] == 'R':
            ri += 1
    if LR_list[i] == 'R':
        values.append(li-ri)
value = 1
for i in range(len(values)):
    value = value * values[i] % (10**9+7)
for i in range(2,n+1):
    value = value * i %(10**9+7)
print(value)

Buggy submission (verdict: Runtime Error):
import math
import sys
from copy import copy
import numpy as np
from collections import defaultdict, deque, Counter 
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)

n = int(input())
s = list(input())

count = 0


if s[0] == 'W' or s[-1] == 'W':
    print(0)
    sys.exit()

LR_list = ['' for i in range(2*n)]
LR_list[0] = 'L'

for i in range(1,len(LR_list)):
    if s[i] == s[i-1]:
        if LR_list[i-1] == 'R':
            LR_list[i] = 'L'
        else:
            LR_list[i] = 'R'
    else:
        if LR_list[i-1] == 'R':
            LR_list[i] = 'R'
        else:
            LR_list[i] = 'L'

values = []

if LR_list.count('L') != LR_list.count('R'):
    print(0)
    sys.exit()
for i in range(len(LR_list)):
    if LR_list[i] == 'R':
        values.append(li-ri)
        li = LR_list[:i].count('L')
        ri = LR_list[:i].count('R')
print(np.array(values).prod()*math.factorial(n))
Problem p03037 (python)

Fixed submission:

N, M = map(int,input().split())
LRs = [list(map(int,input().split())) for _ in range(M)]

current_L = 1
current_R = N
for L,R in LRs:
    if current_L < L:
        current_L = L
    if current_R > R:
        current_R = R


if current_R < current_L:
    print(0)
else:
	print(current_R-current_L+1)

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

Ss = [list(map(int,input().split()))[1:] for _ in range(M)]
Ps = list(map(int,input().split()))

ans = 0
switch_pattern_num = 2**N

for i in range(switch_pattern_num):
    binary = format(i,'0%ib'%N)
    satisfied = True
    for j,S in enumerate(Ss):
        count = 0
        for e in S:
            if int(binary[e-1]):
                count += 1
        if count % 2 != Ps[j]:
            satisfied = False
    if satisfied:
        ans += 1
print(ans)
Problem p03043 (python)

Fixed submission:
N,K = map(int,input().split())
import math
ans = 0.
for c in range(1,N+1):
    if c >= K:
        req = 0
    else:
        req = math.log2(K/c)
        if req != int(req):
            req = int(req) + 1
        else:
            req = int(req)
    ans += (1/N)*((1/2)**req)
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
import math
ans = 0.
for c in range(1,N+1):
    if c >= K:
        req = 0
    else:
        req = int(math.log2(K/c)) + 1
    ans += (1/N)*((1/2)**req)
print(ans)
Problem p03164 (python)

Fixed submission:
N,W = map(int,input().split())
WV = []
for i in range(N):
    WV.append(list(map(int,input().split())))
dp = [[float('inf') for j in range(100001)] for i in range(N)]
dp[0][0] = 0
for i in range(N):
    w,v = WV[i]
    if i == 0:
        dp[i][v] = w
    else:
        for j in range(100001):
            if j-v >= 0:
                dp[i][j] = min(dp[i-1][j-v]+w,dp[i-1][j])
            else:
                dp[i][j] = dp[i-1][j]

ans = 0
for i,e in enumerate(dp[-1]):
    if W >= e:
        ans = i
print(ans)

Buggy submission (verdict: Runtime Error):
N,W = map(int,input().split())
WV = []
for i in range(N):
    WV.append(list(map(int,input().split())))
dp = [[] for i in range(N)]
dp[0].append((0,0))
for i in range(N):
    if i == 0:
        dp[i].append((0,0))
        if W >= WV[i][0]:
            dp[i].append((WV[i][0],WV[i][1]))
    else:
        dp[i].append((e1,e2))
        for e1,e2 in dp[i-1]:
            if W >= e1+WV[i][0]:
                dp[i].append((e1+WV[i][0],e2+WV[i][1]))
ans = 0
for e1,e2 in dp[-1]:
    ans = max(e2,ans)
print(ans)
Problem p03266 (python)

Fixed submission:
N,K = map(int,input().split())
if K % 2 == 1:
    print((N // K) ** 3)
else:
    print((N // K) ** 3 + ((N + K // 2) // K) ** 3)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
if k % 2 == 1:
    print((n // k) ** 3)
else:
    print((n // k) ** 3 + ((n + k // 2) // k) ** 3)
Problem p03379 (python)

Fixed submission:
from bisect import bisect_left
N = int(input())
X = list(map(int,input().split()))
Y = X.copy()
Y.sort()
for i in range(N):
    k = bisect_left(Y,X[i])
    if k < N//2:
        print(Y[N//2])
    else:
        print(Y[N//2-1])

Buggy submission (verdict: Runtime Error):
from bisect import bisect_left
N = int(input())
X = list(map(int,input().split()))
Y = X.copy()
Y.sort()
for i in range(N):
    k = bisect_left(Y,X[i])
    if k < N//2:
        print(Y[N//2])
    else:
        print(Y[N//2-1])
Problem p03549 (python)

Fixed submission:
N,M = map(int,input().split())
print((1900*M+100*(N-M))*2**M)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
print((1900*M+100*(N-m))*2**M)
Problem p03612 (python)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(N):
    if i+1 == P[i]:
        if i+1 == N:
            P[i],P[i-1] = P[i-1],P[i]
        else:
            P[i],P[i+1] = P[i+1],P[i]
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(N):
    if i+1 == P[i]:
        P[i],P[i+1] = P[i+1],P[i]
        ans += 1
print(ans)
Problem p03625 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
from collections import defaultdict
D = defaultdict(int)
for e in A:
    D[e] += 1
l1 = []
l2 = []
for key,value in D.items():
    if value > 1:
        l1.append(key)
    if value > 3:
        l2.append(key)
if len(l1) < 2:
    print(0)
    exit()
l1.sort()
l2.sort()
if len(l2) > 0:
    print(max(l1[-1]*l1[-2],l2[-1]*l2[-1]))
else:
    print(l1[-1]*l1[-2])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
from collections import defaultdict
D = defaultdict(int)
for e in A:
    D[e] += 1


l1 = []
l2 = []
for key,value in D.items():
    if value > 1:
        l1.append(key)
    if value > 3:
        l2.append(key)
if len(l1) < 2:
    print(0)
    exit()
l1.sort()
l2.sort()
print(max(l1[-1]*l1[-2],l2[-1]*l2[-1]))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
from collections import defaultdict
D = defaultdict(int)
for e in A:
    D[e] += 1
possible_length = []
for key,value in D.items():
    if value > 1:
        possible_length.append(key)
if len(possible_length) < 2:
    print(0)
possible_length.sort()
print(possible_length[-1]*possible_length[-2])
Problem p03673 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [-10000 for i in range(N)]
for i in range(N):
    if (N-i)%2 != 0:#from front
        index = (N-i)//2
        B[index] = A[i]
    else:# from backward
        index = N - (N-i)//2
        B[index] = A[i]
ans = ''
for e in B:
    ans += str(e)+' '
print(ans[:-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
B = [-10000 for i in range(N)]
for i in range(N):
    if (N-i)%2 != 0:#from front
        index = (N-i)//2
        B[index] = A[i]
    else:# from backward
        index = N - (N-i)//2
        B[index] = A[i]
print(" ".join(B))
Problem p04011 (python)

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if N < K:
    print(N*X)
else:
    print(K*X+(N-K)*Y)

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

def make_array(dims,fill):
    if len(dims) == 1:
        return [fill]*dims[0]
    ret = []
    nxt = dims[1:]
    for i in range(dims[0]):
        ret.append(make_array(nxt,fill))
    return ret
S = sum(X)+1
dp = make_array([N+2,N+2,S],0)
dp[0][0][0] = 1
for i in range(N):
    for j in range(N):
        for s in range(S-X[i]):
            dp[i+1][j+1][s+X[i]] += dp[i][j][s]
            dp[i+1][j][s] += dp[i][j][s]
ans = 0
for j in range(1,N+1):
    for s in range(1,S+1):
        if j*A == s:
            ans += dp[-2][j][s]
print(ans)
Problem p03000 (python)

Fixed submission:
N,X=list(map(int,input().split()))
L=list(map(int,input().split()))
cnt=1
d=0
for i in L:
    d+=i
    if d<=X:
        cnt+=1

print(cnt)

Buggy submission (verdict: Runtime Error):
N,X=list(map(int,input().split()))
L=list(map(int,input().split()))
cnt=1
d=0
for i in L:
    d+=L[i]
    if d<=X:
        cnt+=1

print(cnt)
Problem p03624 (python)

Fixed submission:
S=input()
alpha="abcdefghijklmnopqrstuvwxyz"
l=[]
for s in alpha:
    if s not in S:
        l.append(s)
if len(l)==0:
    print("None")
    exit()
l.sort()
print(l[0])

Buggy submission (verdict: Runtime Error):
alpha="abcdefghijklmnopqrstuvwxyz"
s=input()
s1=set(s)
s2=sorted(list(s1))
if len(alpha)>len(s2):
    a=list(alpha)
    for i in range(s2):
        a.remove(i)
    print(a[0])
    exit()
for i in range(len(alpha)):
    if s2[i]!=alpha[i]:
        print(alpha[i])
        exit()
print("None")

Buggy submission (verdict: Runtime Error):
alpha="abcdefghijklmnopqrstuvwxyz"
s=input()
s1=set(s)
s2=sorted(list(s1))
for i in range(len(alpha)):
    if i==len(s2):
        if s2[i]=='a':
            print('b')
        else:
            print('a')
        break
    if s2[i]!=alpha[i]:
        print(alpha[i])
        exit()
print("None")

Buggy submission (verdict: Runtime Error):
alpha="abcdefghijklmnopqrstuvwxyz"
s=input()
s1=set(s)
s2=sorted(list(s1))
for i in range(len(alpha)):
    if s2[i]!=alpha[i]:
        print(alpha[i])
        exit()
print("None")
Problem p02713 (python)

Fixed submission:
k = int(input())
from math import gcd
sum = 0
for a in range(1, k+1):
  for b in range(1, k+1):
    for c in range(1, k+1):
      sum += gcd(a, gcd(b,c))
print(sum)

Buggy submission (verdict: Runtime Error):
k = int(input())
sum = 0
for a in range(1,k+1):
  for b in range(1,k+1):
    for c in range(1,k+1):
      sum += gcd(a,gcd(b,c))
print(sum)

Buggy submission (verdict: Runtime Error):
k = int(input())
sum = 0
for a in range(1,k+1):
  for b in range(1,k+1):
    for c in range(1,k+1):
      sum += gcd(a,b,c)
print(sum)
Problem p03339 (python)

Fixed submission:
n = int(input())
s = input()
w = [0]*(n+1)
e = [0]*(n+1)
for i in range(1,n+1):
    if s[i-1] == 'E':
        e[i] = e[i-1] + 1 
        w[i] = w[i-1]
    else:
        e[i] = e[i-1]
        w[i] = w[i-1] + 1

ans = n
for i in range(n):
    ans = min(ans,w[i]+e[n]-e[i+1])
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
w = [0]*(n+1)
e = [0]*(n+1)
for i in range(1,n+1):
    if s.at(i) == 'E':
        e[i] = e[i-1] + 1 
        w[i] = w[i-1]
    else:
        e[i] = e[i-1]
        w[i] = w[i-1] + 1

ans = n
for i in range(n):
    ans = min(ans,w[i]+e[n]-e[i+1])
print(ans)
Problem p03351 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
print('Yes' if(abs(c-a)<=d or (abs(b-a)<=d and abs(c-b)<=d)) else 'No')

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
print('Yes' if(abs(c-a)<=d or (abs(b-a)<=d and abd(c-b)<=d)) else 'No')
Problem p03353 (python)

Fixed submission:
s = input()
k = int(input())
t = sorted(s)[min(k-1,len(s)-1)]
data = []
for i in range(len(s)):
    if s[i] <= t:
        data.append(s[i:])
data.sort()
if len(data) > k:
    data = data[:k]

ndata = []
for ss in data:
    for i in range(len(ss)):
        ndata.append(ss[:i+1])
ndata = list(set(ndata))
ndata.sort()
print(ndata[k-1])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
t = sorted(s)[k-1]
data = []
for i in range(len(s)):
    if s[i] <= t:
        data.append(s[i:])
data.sort()
if len(data) > k:
    data = data[:k]

ndata = []
for ss in data:
    for i in range(len(ss)):
        ndata.append(ss[:i+1])
ndata = list(set(ndata))
ndata.sort()
print(ndata[k-1])
Problem p03469 (python)

Fixed submission:
s = input()
l = list(s)
l[3] = '8'
s = "".join(l)
print(s)

Buggy submission (verdict: Runtime Error):
s = input()
s[3] = '8'
print(s)

Buggy submission (verdict: Runtime Error):
s = input()
s[3] = 8
print(s)
Problem p03470 (python)

Fixed submission:
n = int(input())
data = []
for i in range(n):
  d = int(input())
  data.append(d)
Data = sorted(data)
cnt = 0
tmp = -1
for i in Data:
  if(tmp < i):
    cnt += 1
    tmp = i
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
data = []
for i in range(n):
  d = int(input())
  data.append(d)
Data = sorted(data)
cnt = 0
tmp = -1
for i in Data:
  if(tmp < Data[i]):
    cnt += 1
    tmp = Data[i]
print(cnt)
Problem p03575 (python)

Fixed submission:
n,m = map(int,input().split())
data = []
G = [[] for i in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    data.append((a-1,b-1))
    G[a-1].append(b-1)
    G[b-1].append(a-1)

def dfs(v,seen):
    if seen[v]: return
    seen[v] = True
    for nv in G[v]:
        dfs(nv,seen)

cnt = 0

for i in range(m):
    ra,rb = data[i]
    G[ra].remove(rb)
    G[rb].remove(ra)
    seen = [False]*n
    dfs(0,seen)
    cnt += (sum(seen) != n)
    G[ra].append(rb)
    G[rb].append(ra)

print(cnt)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
data = []
G = [[] for i in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    data.append((a-1,b-1))
    G[a].append(b)
    G[b].append(a)

def dfs(v,seen):
    if seen[v]: return
    seen[v] = True
    for nv in G[v]:
        dfs(nv,seen)

cnt = 0

for i in range(m):
    ra,rb = data[i]
    G[ra].remove(rb)
    G[rb].remove(ra)
    seen = [False]*n
    cnt += (sum(seen) == n)
    G[a].append(b)
    G[b].append(a)

print(cnt)
Problem p03693 (python)

Fixed submission:
r,g,b = map(int,input().split())
if((g*10+b) % 4 == 0):
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
r = int(input())
g = int(input())
b = int(input())
if(g*10+b % 4 == 0):
  print('YES')
else:
  print('NO')
Problem p03695 (python)

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

dic = [False]*8

cnt = 0

for i in range(n):
  tmp = A[i] // 400
  if(tmp >= 8):
    cnt += 1
  else:
    dic[tmp] = True
if(sum(dic) == 0 and cnt > 0):
  print('1 ' + str(cnt))
else:
  print(str(sum(dic)) + ' ' + str(sum(dic) + cnt))

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

dic = [False]*7

cnt = 0

for i in range(n):
  tmp = A[i] // 400
  if(tmp >= 8):
    cnt += 1
  else:
    dic[tmp] = True
  
print(sum(dic))
print(sum(dic) + cnt)

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

dic = [False]*7

cnt = 0

for i in range(n):
  tmp = A[i] // 400
  if(tmp >= 8):
    cnt += 1
  else:
    dic[tmp] = True
  
print(str(sum(dic)) + ' ' + str(sum(dic) + cnt))