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

Fixed submission:
def main():
    n = int(input())
    a = []
    sum = 0             #longの気持ち
    ans = 0             #long long の気持ち
    mod = 1_000_000_000 + 7
    x = list(map(int, input().split()))
    for i in range(n):
        sum += x[i]           
        a.append(x[i])
    
    for i in range(n):
        sum -= a[i]
        ans += sum * a[i]
        ans %= mod
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    long long ans = 0, sum =0;
    int mod = 1000000000+7;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a.at(i);
        sum += a.at(i);
        sum %= mod;
    }
    for (int i = 0; i < N; i++) {
        sum -= a.at(i);
        if(sum<0) sum += mod;
        ans += sum * a.at(i);
        ans %= mod;
    }
    cout << ans << endl;
}

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    long long ans = 0, sum =0;
    int mod = 1000000000+7;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a.at(i);
        sum += a.at(i);
    }
    for (int i = 0; i < N-1; i++) {
        sum -= a.at(i);
        if(sum<0) sum += mod;
        ans += sum * a.at(i);
        ans %= mod;
    }
    cout << ans << endl;
}
/*

*/
Problem p02549 (python)

Fixed submission:
N, K = map(int, input().split())
LR = [list(map(int, input().split())) for i in range(K)]
MOD = 998244353

dp = [0] * (N + 1)
dp[1] = 1
dp_sum = [0] * (N + 1)
dp_sum[1] = 1


def get(l, r, i):
    return dp_sum[max((i - l), 0)] - dp_sum[max((i - r-1), 0)]


for i in range(1, N+1):
    for l, r in LR:
        dp[i] += get(l, r, i) % MOD
    dp_sum[i] = (dp_sum[i - 1] + dp[i])%MOD
print(dp[N] % MOD)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
LR = set()
MOD = 998244353

for i in range(K):
    l, r = map(int, input().split())
    for j in range(l, r + 1):
        LR.add(j)
#print(list(LR))


class Search:
    def __init__(self):
        self.ans = 0

    def dfs(self, now):
        if now == N:
            self.ans += 1
            return
        if now > N:
            return
        for d in LR:
            self.dfs(d + now)


s = Search()
s.dfs(1)
print(s.ans % MOD)

# LR = [list(map(int,input().split())) for i in range(N)]
# dp = [0] * (N + 1)
# dp[0] = 1
# for i in range(1, N):
#     for d in LR:
#         if i - d < 0: break
#         dp[i] += (dp[i - d]) % MOD
# print(dp[N-1] % MOD)
Problem p03038 (python)

Fixed submission:
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
target = [list(map(int, input().split())) for i in range(M)]
target = sorted(target, key = lambda x:x[1], reverse=True)
# print(target)

'''
4 4
1 3
2 2
1 1
2 4


'''


for t in target:
    A.extend([t[1]] * t[0])
    if len(A) > N * 2:
        break
A.sort(reverse=True)

print(sum(A[:N]))

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
target = [list(map(int, input().split())) for i in range(M)]

'''
4 4
1 3
2 2
1 1
2 4


'''
A.sort()

tmp = []

for t in target:
    for i in range(t[0]):
        tmp.append(t[1])
tmp.sort(reverse=True)


#print(A)
#print(tmp)
for i,a in enumerate(A):
    if A[i] < tmp[i] and i < len(tmp) :
        A[i] = tmp[i]
        #print(A)
    else:
        break

print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
target = [list(map(int, input().split())) for i in range(M)]

'''
4 4
1 3
2 2
1 1
2 4


'''
A.sort()

tmp = []

for t in target:
    for i in range(t[0]):
        tmp.append(t[1])
tmp.sort(reverse=True)


#print(A)
#print(tmp)
for i,a in enumerate(A):
    if A[i] < tmp[i]:
        A[i] = tmp[i]
        #print(A)
    else:
        break

print(sum(A))
Problem p03075 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

city = [e,d, c, b, a]
result = 'Yay!'
for i, c in enumerate(city):
    for cC in city[i + 1:len(city)]:
        if (c - cC) > k:
            result = ':('
            break;
print(result)

Buggy submission (verdict: Runtime Error):
a, b, c, d, e, k = (int(i) for i in int(input()))
city = (d, c, b, a)
result = 'Yay!'
for i, c in enumerate(city):
    for cC in city.index(i + 1, city.count()):
        if (c - cC) > k:
            result = ':('
            break;
print(result)
Problem p03107 (python)

Fixed submission:
C = [int(i) for i in input()]

zero_cnt = C.count(0)
one_cnt = C.count(1)
print(min(zero_cnt,one_cnt) *2)

Buggy submission (verdict: Runtime Error):
C = [int(i) for i in input()]

pre = len(C)

def recursive(list):
    if len(list) == 0:
        return []
    for i,l in enumerate(list):
        if i == len(list) -1:
            break
        if (list[i] ==0 and list[i + 1] == 1) or (list[i] ==1 and list[i +1 ] ==0 ):
            #print(list)
            list.pop(i)
            list.pop(i)
            recursive(list)

recursive(C)
print(pre -len(C))

Buggy submission (verdict: Runtime Error):
C = [int(i) for i in input()]

def recursive(list):
    if len(list) == 0:
        return []
    for i,l in enumerate(list):
        if i == len(list) -1:
            break
        if list[i] ==0 and list[i + 1] == 1:
            list.pop(i)
            list.pop(i)
            recursive(list)

recursive(C)
print(len(C))
Problem p03127 (python)

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

result = A
while True:
    result = list(set(result))
    result.sort()
    if min(result) == 0:
        result.remove(0)
    tmp_min = min(result)
    #print(result)
    if len(result) == 1:
        break
    result =[r % tmp_min for r in result[1:]]
    #print(result)
    if max(result) == 0:
        result.append(tmp_min)
        break
    result.append(tmp_min)
    #print(result)

print(max(result))

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

result = A
while True:
    result = list(set(result))
    result.sort()
    if min(result) == 0:
        result.remove(0)
    tmp_min = min(result)
    result =[r % tmp_min for r in result[1:]]
    #print(result)
    if max(result) == 0:
        result.append(tmp_min)
        break
    result.append(tmp_min)
    #print(result)

print(max(result))
Problem p03315 (python)

Fixed submission:
S = input()
result = 0
for s in S:
    if s == '+':
        result += 1
    else:
        result -= 1
print(result)

Buggy submission (verdict: Runtime Error):
S = int(input())
ans = 0
for s in S:
    if s == '+':
        ans += 1
    else:
        ans -= 1
print(ans)
Problem p03775 (python)

Fixed submission:
n = int(input())
num = 1
for i in range(1, int(n**0.5)+1):
    if n % i == 0:
       num = i

ans = len(str(max(num, n // num)))
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
low, upper = [], []
i = 1
while i*i <= n:
    if n % i == 0:
        low.append(i)
        if i != n//i:
            upper.append(n//i)

    i += 1
print(len(str(min(upper))))
Problem p02570 (python)

Fixed submission:
d,t,s=map(int,input().split())

num=t*s

if num>=d:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
t=input()

if len(s)==len(t):
  num=0
  for i,j in zip(s,t):
    if i!=j:
      num+=1
else:
  for i in range(len(s)-len(t)+1):
    a=s[i:len(t)+i]
    num=0
    for i,j in zip(t,a):
      if i!=j:
        num+=1
    num=min(1000,num)

print(num)
Problem p02623 (python)

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

asum=[0]
bsum=[0]

for i in range(n):
  asum.append(asum[i]+A[i])
  
for j in range(m):
  bsum.append(bsum[j]+B[j])

ans=0
ko=m
for i in range(n+1):
  if asum[i]>k:
    break
  while asum[i]+bsum[ko]>k:
    ko-=1
  ans=max(ans,i+ko)
  
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))

for a in A:
  A[a]+=A[a+1]
  
for b in B:
  B[b]+=B[b+1]

ans=0
op=m
for i in range(n+1):
  if A[i]>k:
    break
  while A[i]+B[op]>k:
    op-=1
   
  ans=max(ans,i+op)
  
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))

for a in A:
  A[a]+=A[a+1]
  
for b in B:
  B[b]+=B[b+1]

ans=0
op=m
for i in range(n+1):
  while A[i]+B[op]>k:
    op-=1
   
  ans=max(ans,i+op)
  
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

ans=0
count=0
i,j=0,0
while ans<k:
  if i > n-1:
    num=b[j]
  if j > m-1:
    num=a[i]
  else:
    num=min(a[i],b[j])
    if num==a[i]:
      i+=1
      count+=1
      ans+=num
    else:
      j+=1
      count+=1
      ans+=num
  
print(count-1)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

ans=0
count=0
i,j=0,0
while ans<k:
  if i > n-1:
    num=b[j]
  if j > m-1:
    num=a[i]
  else:
    num=min(a[i],b[j])
    if num==a[i]:
      i+=1
      count+=1
      ans+=num
    else:
      j+=1
      count+=1
      ans+=num
  
print(count)
Problem p02624 (python)

Fixed submission:
n=int(input())

ans=0
for i in range(1,n+1):
  num=n//i
  ans+=i*num*(num+1)//2
  
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())

ans=0
for i in rabge(1,n+1):
  num=n//i
  ans+=i*num*(num+1)/2
  
print(ans)
Problem p02627 (python)

Fixed submission:
a=str(input())

if a.isupper()==True:
  print("A")

else:
  print("a")

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
q=int(input())
before=[]
after=[]
for i in range(q):
    a,b=input().split()
    before.append(int(a))
    after.append(int(b))
    
for i in range(q):
  if before[i] in l:
    l=[after[i] if j == before[i] else j for j in l]
  print(sum(l))
Problem p02659 (python)

Fixed submission:
s=input().split()
a=int(s[0])
b=int(float(s[1])*1000) 
ans=a*b
print(ans//1000)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
ans=a*b
ans=ans//1
print(int(ans))

Buggy submission (verdict: Runtime Error):
a,b =map(int,input().split())
ans=a*b
ans=ans//1
print(ans)

Buggy submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())
ans = a*b

print(math.floor(ans))

Buggy submission (verdict: Runtime Error):
import math

a, b = map(int, input.split())
ans = a*b

print(math.floor(ans))
Problem p02725 (python)

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

diff=[]
l.append(l[0]+k)
for i in range(n):
  diff.append(l[i+1]-l[i])

print(sum(diff)-max(diff))

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

diff=[]
l.append(l[0]+k)

for i in range(n-1):
  diff.append(l[n+1]-l[n])
  
print(sum(diff)-max(diff))
Problem p02873 (python)

Fixed submission:
s=input()

sl=len(s)+1
l=[0]*sl

for i in range(sl-1):
  if s[i]=="<":
    l[i+1]=l[i]+1
    
for i in range(sl-2,-1,-1):
  if s[i]==">":
    l[i]=max(l[i+1]+1, l[i])
    
print(sum(l))

Buggy submission (verdict: Runtime Error):
s=int(input())

sl=len(s)+1
l=[0]*sl

for i in range(sl-1):
  if s[i]=="<":
    l[i+1]=l[i]+1
    
for i in range(sl-2,-1,-1):
  if s[i]==">":
    l[i]=max(l[i+1], l[i])
    
print(sum(l))
Problem p03137 (python)

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

if n>=m:
  print(0)
else:
  num=n-1
  sl=sorted(l)

  dsl=[abs(sl[i+1]-sl[i]) for i in range(m-1)]

  dsl=sorted(dsl)
  print(sum(dsl[0:len(dsl)-num]))

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

if m==1:
  print(0)
else:
  num=n-1
  sl=sorted(l)

  dsl=[abs(sl[i+1]-sl[i]) for i in range(m-1)]

  for i in range(num):
    ml=max(dsl)
    dsl.remove(ml)
  
  print(sum(dsl))

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

num=n-1
sl=sorted(l)

dsl=[sl[i+1]-sl[i] for i in range(m-1)]
priny(dsl)
Problem p03745 (python)

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

if n<=2:
  print(1)
  exit()
  
cnt=0

if l[0]>l[1]:
  ans="low"
elif l[0]<l[1]:
  ans="high"
else:
  ans="even"
  
for i in range(2,n):
  if l[i-1]>l[i] and (ans=="low" or ans=="even"):
    ans="low"
  elif l[i-1]<l[i] and (ans=="high" or ans=="even"):
    ans="high"
  elif l[i-1]==l[i]:
    continue
  else:
    cnt+=1
    ans="even"
    
print(cnt+1)

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

if n=<2:
  print(1)
  exit()
  
cnt=0

if l[0]>l[1]:
  ans="low"
elif l[0]<l[1]:
  ans="high"
else:
  ans="even"
  
for i in range(2,n):
  if l[i-1]>l[i] and (ans=="low" or ans=="even"):
    ans="low"
  elif l[i-1]<l[i] and (ans=="high" or ans=="even"):
    ans="high"
  elif l[i-1]==l[i]:
    continue
  else:
    cnt+=1
    ans="even"
    
print(cnt+1)

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

cnt=0

if l[0]>l[1]:
  ans="low"
elif l[0]<l[1]:
  ans="high"
else:
  ans="even"
  
for i in range(2,n):
  if l[i-1]>l[i] and (ans=="low" or ans=="even"):
    ans="low"
  elif l[i-1]<l[i] and (ans=="high" or ans=="even"):
    ans="high"
  elif l[i-1]==l[i]:
    ans="even"
  else:
    cnt+=1
    ans="even"
    
print(cnt+1)
Problem p03774 (python)

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

a_lis=[list(map(int,input().split())) for i in range(n)]
c_lis=[list(map(int,input().split())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**10
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)

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

a_lis=[list(map(int,input())) for i in range(n)]
c_lis=[list(map(int,input())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**10
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)

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

a_lis=[list(map(int,input().split())) for i in range(n)]
c_lis=[list(map(int,input().split())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**8
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)

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

a_lis=[list(map(int,input())) for i in range(n)]
c_lis=[list(map(int,input())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**8
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)
Problem p02879 (python)

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

if (9<A or 9<B):
  print(-1)
else:
  print(A*B)

Buggy submission (verdict: Runtime Error):

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

if 9<A || 9<B:
  print(-1)
else:
  print(A*B)
Problem p02970 (python)

Fixed submission:
N, D = map(int, input().split())
 
result = -(-N // (2*D+1))
 
print(result)

Buggy submission (verdict: Runtime Error):
N, D = map(int, input().split())
 
result = -(-N // (2D+1))
 
print(result)

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

result = N // (2D+1) + 1

print(result)
Problem p02623 (python)

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

A = [0] * (n + 1)
for i in range(1, n + 1):
    A[i] = A[i - 1] + a[i - 1]

B = [0] * (m + 1)
for i in range(1, m + 1):
    B[i] = B[i - 1] + b[i - 1]

ans = 0
best = m
for i in range(n + 1):
    for j in range(best, -1, -1):
        t = A[i] + B[j]
        if t <= k:
            ans = max(ans, i + j)
            best = j
            break
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

def dfs(ai, bi, t, c):
    if t > k:
        return c - 1
    elif ai == n and bi == m:
        return c
    elif ai == n:
        return dfs(ai, bi + 1, t + b[bi], c + 1)
    elif bi == m:
        return dfs(ai + 1, bi, t + a[ai], c + 1)
    return max(dfs(ai + 1, bi, t + a[ai], c + 1), dfs(ai, bi + 1, t + b[bi], c + 1))

ans = dfs(0, 0, 0, 0)

print(ans)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

def dfs(ai, bi, t, c):
    if t > k:
        return c - 1
    elif ai == n and bi == m:
        return c
    elif ai == n:
        return dfs(ai, bi + 1, t + b[bi], c + 1)
    elif bi == m:
        return dfs(ai + 1, bi, t + a[ai], c + 1)
    return max(dfs(ai + 1, bi, t + a[ai], c + 1), dfs(ai, bi + 1, t + b[bi], c + 1))

ans = dfs(0, 0, 0, 0)

print(ans)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

def dfs(ai, bi, t, c):
    if t > k:
        return c - 1
    elif ai == n - 1 and bi == m - 1:
        return c
    elif ai == n - 1:
        return dfs(ai, bi + 1, t + b[bi], c + 1)
    elif bi == m - 1:
        return dfs(ai + 1, bi, t + a[ai], c + 1)
    return max(dfs(ai + 1, bi, t + a[ai], c + 1), dfs(ai, bi + 1, t + b[bi], c + 1))

ans = dfs(0, 0, 0, 0)

print(ans)

Buggy submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

def dfs(ai, bi, t, c):
    if t > k:
        return c - 1
    elif ai == n and bi == m:
        return c
    elif ai == n:
        return dfs(ai, bi + 1, t + b[bi], c + 1)
    elif bi == m:
        return dfs(ai + 1, bi, t + a[ai], c + 1)
    return max(dfs(ai + 1, bi, t + a[ai], c + 1), dfs(ai, bi + 1, t + b[bi], c + 1))

ans = dfs(0, 0, 0, 0)

print(ans)
Problem p02701 (python)

Fixed submission:
n = int(input())
s = [input() for _ in range(n)]
print(len(set(s)))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = (input() for _ in range(n))
print(len(s))
Problem p02773 (python)

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
s.sort()
ans = []
c = 1
max = 0
for i in range(1, n):
    if s[i - 1] == s[i]:
        c += 1
    else:
        if c == max:
            ans.append(s[i - 1])
        elif c > max:
            ans.clear()
            ans.append(s[i - 1])
            max = c
        c = 1
if c == max:
    ans.append(s[-1])
elif c > max:
    ans.clear()
    ans.append(s[n - 1])
for des in ans:
    print(des)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [input() for i in range(n)]
s.sort()
ans = []
c = 1
max = 0
for i in range(1, n):
    if s[i - 1] == s[i]:
        c += 1
    else:
        if c == max:
            ans.append(s[i - 1])
        elif c > max:
            ans.clear()
            ans.append(s[i - 1])
            max = c
        c = 1
if c == max:
    ans.append(s[-1])
elif c > max:
    ans.clear()
    ans.append(s[n - 1])
for des in ans:
    print(des)
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()
ans = "No"
if n % 2 == 0:
    ans = "Yes"
    for i in range(n // 2):
        if s[i] != s[n // 2 + i]:
            ans = "No"
            break
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
ans = "No"
if n % 2 == 0:
    ans = "Yes"
    for i in range(n / 2):
        if s[i] != s[n / 2 + i]:
            ans = "No"
            break
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
ans = "No"
if n % 2 == 0:
    if s[0:n / 2] == s[n / 2:]:
        ans = "Yes"
print(ans)
Problem p02773 (python)

Fixed submission:

N = int(input())
L = [ input() for i in range(N)]
#print(L)
    
dic = {}
m = 0

for i in L:
    if i in dic:
        dic[i] = dic[i] + 1
    else:
        dic[i] = 1
        
    if m < dic[i]:
        m = dic[i]

n = []
for i in dic:
    if dic[i] == m:
        n.append(i)
n.sort()
for i in n:
    print(i)

Buggy submission (verdict: Runtime Error):
    
dic = {}
m = 0

for i in L:
    if i in dic:
        dic[i] = dic[i] + 1
    else:
        dic[i] = 1
        
    if m < dic[i]:
        m = dic[i]

n = []
for i in dic:
    if dic[i] == m:
        n.append(i)
n.sort()
for i in n:
    print(i)
Problem p02688 (python)

Fixed submission:
n,m=map(int,input().split())
lis=[i for i in range(1,n+1)]
for i in range(m):
    d=int(input())
    a=list(map(int,input().split()))
    for j in range(d):
        if a[j] in lis:
            lis.remove(a[j])
print(len(lis))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
lis=[i for i in range(1,n+1)]
for i in range(m):
    d=int(input())
    for j in range(d):
        a=int(input())
        if a in lis:
            lis.remove(a)
print(len(lis))
Problem p02689 (python)

Fixed submission:
n,m=map(int,input().split())
H=list(map(int,input().split()))
ans=[i  for i in range(1,n+1)]
low=[]
for i in range(m):
    x,y=map(int,input().split())
    if H[x-1]==H[y-1]:
        low.append(x)
        low.append(y)
    elif  H[x-1]>H[y-1]:
        low.append(y)
    else:
        low.append(x)
low=list(set(low))
print(len(ans)-len(low))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
H=list(map(int,input().split()))
ans=[i  for i in range(1,n+1)]
low=[]
load=[map(int,input().split()) for j in range(m)]
for i in range(m):
    if H[load[i][0]-1]==H[load[i][1]-1]:
        low.append(load[i][0])
        low.append(load[i][1])
    elif  H[load[i][0]-1]>H[load[i][1]-1]:
        low.append(load[i][1])
    else:
        low.append(load[i][0])
low=list(set(low))
for k in low:
    ans.remove(k)
print(len(ans))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
H=list(map(int,input().split()))
ans=[i  for i in range(1,n+1)]
low=[]
for i in range(m):
    x,y=map(int,input().split())
    if H[x-1]==H[y-1]:
        low.append(x)
        low.append(y)
    elif  H[x-1]>H[y-1]:
        low.append(y)
    else:
        low.append(x)
low=list(set(low))
for k in low:
    ans=ans.remove(k)
print(len(ans))
Problem p02695 (python)

Fixed submission:
import itertools
n,m,q=map(int,input().split())
lis=[i for i  in range(1,m+1)]
lis=list(itertools.combinations_with_replacement(lis,n))
box=[0 for j in range(len(lis))]
for i in range(q):
    que=list(map(int,input().split()))
    for j in range(len(lis)):
        if lis[j][que[1]-1]-lis[j][que[0]-1]==que[2]:
            box[j]+=que[3] 
print(max(box))

Buggy submission (verdict: Runtime Error):
import itertools
n,m,q=map(int,input().split())
lis=[i for i  in range(1,m+1)]
lis=list(itertools.combinations(lis,n))
box=[0 for j in range(len(lis))]
que=[list(map(int,input().split())) for k in range(q)]
for i in range(q):
    for j in range(len(lis)):
        if lis[j][que[i][1]-1]-lis[j][que[i][0]-1]==que[i][2]:
            box[j]+=que[i][3] 
print(max(box))

Buggy submission (verdict: Runtime Error):
import itertools
n,m,q=map(int,input().split())
lis=[i for i  in range(1,m+1)]
lis=list(itertools.combinations(lis,n))
box=[0 for j in range(len(lis))]
for i in range(q):
    que=list(map(int,input().split()))
    for j in range(len(lis)):
        if lis[j][que[1]-1]-lis[j][que[0]-1]==que[2]:
            box[j]+=que[3] 
print(max(box))
Problem p02711 (python)

Fixed submission:
l=input()
if "7" in l:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l=int(input())
if 7 in l:
    print("Yes")
else:
    print("No")