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

Fixed submission:
nk = list(input().split())
n = nk[0]
k = nk[1]
a = []
c = 0
for i in range(int(k)):
  d = int(input())
  b = list(input().split())
  a.extend(b)
for j in range(1,int(n)+1):
  if str(j) not in a:
    c = c+1
print(c)

Buggy submission (verdict: Runtime Error):
nk = list(input().split())
n = nk[0]
k = nk[1]
a = []
c = 0
for i in range(k):
  d = int(input())
  b = list(input().split())
  a.extend(b)
for j in range(1,n+1):
  if j not in a:
    c = c+1
print(c)

Buggy submission (verdict: Runtime Error):
nk = list(input().split())
n = nk[0]
k = nk[1]
a = []
for i in range(1,k+1):
  d = int(input())
  b = list(input().split())
  a.entend(b)
c = 0
for j in range(1,n+1):
  if j not in a:
    c = c+1
print(c)
Problem p03017 (python)

Fixed submission:
n, a, b, c, d = (int(i) for i in input().split())  
s = str(input())
n = len(s)

m = max([c, d])
if n>m:
    n = m
    s = s[:n]
    
if '##' in s[a-1:]:
    print('No')
elif b>c:
    print('Yes')
else:
    if c>d:
        if '...' in s[b-2:d+1]:
            print('Yes')
        else:
            print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
m = max([c, d])
if n>m:
    n = m
    s = s[:n]
    
if '##' in s:
    print('No')
else:
    if c>d:
        if '...' in s[:d]:
            print('Yes')
        else:
            print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
m = max([c, d])
if n>m:
    n = m
    s = s[:n]
    
if '##' in s:
    print('No')
else:
    if c>d:
        if '...' in s:
            print('Yes')
        else:
            print('No')
    else:
        print('Yes')
Problem p02912 (python)

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

def intm(x):
    return int(x)*-1
A = list(map(intm, input().split()))

import heapq

heapq.heapify(A)
while M>0:
    a = -heapq.heappop(A) // 2
    heapq.heappush(A,-a)
    M -= 1
   

print(-sum(A))

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

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

import heapq
def heapsort(iter):
    h = []
    for value in iter:
        heappush(h, value)
    return [heappop(h) for i in range(len(h))]

def waribiki(X,Y):
    return X//(2**Y)

if len(A)==1:
    while M>0:
        A[0] = waribiki(A[0],1)
        M -= 1
else:
    while M>0:
        #A.sort(reverse=True)
        A = heapsort(A)
        
        m=1
        #while M>0 and waribiki(A[0],m)>A[1]:
        #    m+=1
        A[0] = waribiki(A[0],m)
        M -= m
       

print(sum(A))

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

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

def waribiki(X,Y):
    return X//(2**Y)

A.sort(reverse=True)
while M>0:
    A[0] = waribiki(A[0],1)
    M -= 1
    if len(A)>1:
        if A[0] < A[1]:
            i=0
            while A[i] < A[i+1]:
                tmp = A[i+1]
                A[i+1]=A[i]
                A[i]=tmp
                i+=1

print(sum(A))
Problem p03077 (python)

Fixed submission:
import math

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

move= [A,B,C,D,E]
min_move =min(move) 
min_move_idx = move.index(min_move)
time = 4


time += math.ceil(N/min_move )

print(time)

Buggy submission (verdict: Runtime Error):
X,Y,Z,K = map(int,input().split())

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

A.sort(reverse=True)
A = A[0:K]
B.sort(reverse=True)
B = B[0:K]
AB = [a+b for a in A for b in B]

AB.sort(reverse=True)

AB = AB[0:K]

C.sort(reverse=True)
C=C[0:K]
ABC = [ab+c for ab in AB for c in C]

ABC.sort(reverse=True)

for i in range(K):
    print(ABC[i])
Problem p02847 (python)

Fixed submission:
str = input()
if str=="SUN":
  print(7)
elif str=="MON":
  print(6)
elif str=="TUE":
  print(5)
elif str=="WED":
  print(4)
elif str=="THU":
  print(3)
elif str=="FRI":
  print(2)
else :
  print(1)

Buggy submission (verdict: Runtime Error):
str = input()
if str=="SUN":
  print(7)
elif str=="MON":
  print(6)
elif str=="TUE":
  print(5)
elif str=="WED":
  print(4)
elif str=="THU":
  print(3)
elif str=="FRI":
  print(2)
else str=="SAT":
  print(1)
Problem p02819 (python)

Fixed submission:
import math
x = input()
x = int(x)
if x in [2,3,5,7]:
    print(x)
elif x == 4:
    print(5)
elif x==6:
    print(7)
elif x==8:
    print(11)
else:
    while 1:
        flag = 0
        if x%2==0:
            x= x+1
            continue
        y = 3
        while y<math.sqrt(x):
            if x%y==0:
                break
            y=y+2
            if y>math.sqrt(x):
                flag=1
                break
        if flag == 1:
            print(x)
            break
        x = x+2

Buggy submission (verdict: Runtime Error):
import math
x = input()
x = int(x)
if x in [2,3,5,7]:
    print(x)
elif x == 4:
    print(5)
elif x==6:
    print(7)
elif x==8:
    print(11)
else:
    while:
        flag = 0
        if x%2==0:
            x= x+1
            continue
        y = 3
        while y<math.sqrt(x):
            if x%y==0:
                break
            y=y + 2
            if y>math.sqrt(x):
                flag=1
                break
        if flag == 1:
            print(x)
            break
        x = x+2
Problem p02948 (python)

Fixed submission:
import heapq
import sys

finput = sys.stdin.readline

n,m = map(int, finput().split())

q = [[] for i in range(m)]

for i in range(n):
    a,b = [int(j) for j in finput().split()]
    if a>m:
        continue
    q[a-1].append(-b)

hq = []
heapq.heapify(hq)
ans = 0
for i in range(m):
    if len(hq)==0 and len(q[i])==0:
        continue
    for j in range(len(q[i])):
        heapq.heappush(hq, q[i][j])
    ans += heapq.heappop(hq)

print(-ans)

Buggy submission (verdict: Runtime Error):
import heapq
import sys

finput = sys.stdin.readline

n,m = map(int, finput().split())

q = [[] for i in range(m)]

for i in range(n):
    a,b = [int(j) for j in finput().split()]
    if a>m:
        continue
    q[a-1].append(-b)

hq = []
heapq.heapify(hq)
ans = 0
for i in range(m):
    for j in range(len(q[i])):
        heapq.heappush(hq, q[i][j])
    
    ans += heapq.heappop(hq)
print(-ans)
Problem p02711 (python)

Fixed submission:
N=input()
a=int(N)//100
b=(int(N)-a*100)//10
c=int(N)-100*a-10*b
A=(a==7)
B=(b==7)
C=(c==7)
if A==True or B==True or C==True:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
def sort_2(a,b):
    if b<a:
        c=a
        a=b
        b=c
    return [a,b]


def GCDbase(a,b):
    D=b//a
    if b==D*a:
        return a
    else:
        return GCD(b-a*D,a)
    
def GCD(a,b):
    ab=sort_2(a,b)
    return GCDbase(ab[0],ab[1])
    
    

K=int(input())
sum=0
for i in range(1,K+1):
    for j in range(1,K+1):
	tmp=GCD(i,j)
        for l in range(1,K+1):
            sum+=GCD(tmp,l)
print(sum)

Buggy submission (verdict: Runtime Error):
a=int(N)//100
b=(int(N)-a*100)//10
c=int(N)-100*a-10*b
A=(a==7)
B=(b==7)
C=(c==7)
print(a)
print(b)
print(c)
if A==True or B==True or C==True:
    print("Yes")
else:
    print("No")
Problem p02951 (python)

Fixed submission:
A,B,C = map(int,input().split())
A2 = A-B
if A2 >= C:
    ans =0
else:
    ans = C - A2
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
li = list(map(int,input().split()))
li2 = []
key =[0] #key ０でおｋ　１で1下げ
cnt = 0
flg = True
if N == 1:
    ans ="Yes"
    flg = False
while flg :
    cur1 = li[cnt]
    cur2 = li[cnt+1]
    sa = cur2 - cur1
    if key[cnt] == 0:
        if sa < -1:
            ans = "No"
            flg = False
        elif sa == -1:
            key.append(1)
            cnt += 1
        else:
            key.append(0)
            cnt += 1
    else:
        if sa < 0:
            ans = "No"
            flg = False
        else:
            key.append(0)
            cnt += 1
    if cnt == len(li)-1:
        ans = "Yes"
        flg = False
print(ans)
Problem p03042 (python)

Fixed submission:
S = input()
pre = int(S[0:2])
af = int(S[2:4])
if 1 <= pre <= 12:
    preM = 1
else:
    preM = 0
if 1 <= af <= 12:
    afM = 1
else:
    afM = 0
if preM == 1:
    if afM == 1:
        ans = "AMBIGUOUS"
    else:
        ans = "MMYY"
else:
    if afM == 1:
        ans = "YYMM"
    else:
        ans = "NA"
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
pre = int(S[0:2])
af = int(S[2:4])
if 1 <= pre <= 12:
    preM = 1
else:
    preM = 0
if 1 <= af <= 12:
    afM = 1
else:
    afM = 0
if preM == 1:
    if afM == 1:
        ans = "AMBIGUOUS"
    else:
        ans = "MMYY"
else:
    if afM == 1:
        ans = "YYMM"
    else:
        ans == "NA"
print(ans)
Problem p03072 (python)

Fixed submission:
N = int(input())
li = list(map(int, input().split()))
mireru = []
highest = 0
for i in li:
    if i >= highest:
        mireru.append(1)
        highest = i
print(sum(mireru))

Buggy submission (verdict: Runtime Error):
N = int(input())
li = list(map(int, input().split()))
mireru = []
highest = 0
for i in li:
    if li[i] >= highest:
        mireru.append(1)
        highest = li[i]
print(sum(mireru))
Problem p02773 (python)

Fixed submission:
import collections

N = int(input())
solution = []
S = []

for i in range(N):
  tmp = input()
  S.append(tmp)
  
c = collections.Counter(S)

d = c.most_common()

max_ = d[0][1]

for i,k in enumerate(d):
  if d[i][1] == max_:
    solution.append(d[i][0])
    
solution.sort()

for i in solution:
  print(i)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
S = []
kaisuu = []
solution = []
index = 0

for i in range(N):
  tmp = input()
  
  if (tmp in S) == False:
    S.append(tmp)
    kaisuu.append(1)
    index += 1
  
  if (tmp in S) == True:
    index_tmp = S.index(tmp)
    kaisuu[index_tmp] += 1
  
max_ = max(kaisuu)

for i in range(N):
  if kaisuu[i] == max_:
    solution.append(S[i])
    
solution.sort()

for i in solution:
  print(i)
Problem p02779 (python)

Fixed submission:
N = int(input())
A = []

tmp = input().split()

for i in range(N):
  A.append(int(tmp[i]))
    
A.sort()

hantei = True

for i in range(N-1):
  if A[i] == A[i+1]:
    hantei = False
    
if hantei == True:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
    N = int(input())
    A =[]
     
    hantei = True
    tmp = input().split()
     
    for i in range(N):
      tmp_int = int(tmp[i])
      if tmp_int in A:
        hantei = False
      A.append(tmp_int)
      
     
    if(hantei == True):
      print("YES")
    else:
      print("NO")
Problem p02707 (python)

Fixed submission:
# -*- coding: utf-8 -*-
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    ans = []
    for _ in range(N):
        ans.append(0)
    for i in A:
        ans[i-1]+=1
    for j in ans:
        print(j)
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    ans = []
    for _ in range(N):
        ans.append(0)
    for i in A:
        ans[A[i]-1]+=1
    for j in ans:
        print(j)
if __name__ == '__main__':
    main()
Problem p02773 (python)

Fixed submission:
# -*- coding: utf-8 -*-
from collections import Counter
def main():
    N = int(input())
    S = [input() for i in range(N)]
    c = Counter(S)
    ans = []
    tmp = []
    tmp = c.most_common()
    cmax = c.most_common()[0][1]
    ans = [k for k , j in c.items() if j == cmax]
    ans.sort()
    print('\n'.join(ans))
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from collections import Counter
def main():
    N = int(input())
    S = [str(input()) for i in range(N)]
    c = Counter(S)
    ans = []
    tmp = []
    tmp = c.most_common()
    cmax = c.most_common()[0][1]
    for i in range(N):
        if tmp[i][1] != cmax:
            break
        ans.append(tmp[i][0])
    ans.sort()
    print('\n'.join(ans))
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import collections
def main():
    N = int(input())
    S = [str(input()) for i in range(N)]
    c = collections.Counter(S)
    ans = []
    tmp = []
    tmp = c.most_common()
    cmax = c.most_common()[0][1]
    for i in range(N):
        if tmp[i][1] != cmax:
            break
        ans.append(tmp[i][0])
    ans.sort()
    print('\n'.join(ans))
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import collections
def main():
    N = int(input())
    S = [str(input()) for i in range(N)]
    c = collections.Counter(S)
    ans = []
    tmp = []
    tmp = c.most_common()
    cmax = c.most_common()[0][1]
    for i in range(N):
        if tmp[i][1] != cmax:
            break
        ans.append(tmp[i][0])
    ans.sort()
    for j in ans:
        print(j)
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import collections
def main():
    N = int(input())
    S = [str(input()) for i in range(N)]
    c = collections.Counter(S)
    ans = []
    for i in range(N):
        if c.most_common()[i][1] != c.most_common()[0][1]:
            break
        ans.append(c.most_common()[i][0])
    ans.sort()
    for j in ans:
        print(j)
if __name__ == '__main__':
    main()
Problem p02879 (python)

Fixed submission:
# -*- coding: utf-8 -*-
def main():
    A,B = map(int,input().split())
    if 1 <= A < 10 and 1<= B < 10:
        print(A*B)
    else:
        print('-1')

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
def main():
    A,B = int(input())
    if 1=< A < 10 and 1<= B < 10:
        print(A*B)
    else:
        print('-1')

if __name__ == '__main__':
    main()
Problem p02688 (python)

Fixed submission:
import itertools
n, k = map(int, input().split())
d = []
a = []
n_1=[i for i in range(1,n+1)]
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
a_1 = list(itertools.chain.from_iterable(a))
c=list(set(n_1)-set(a_1))
print(len(c))

Buggy submission (verdict: Runtime Error):
import itertools
n, k = map(int, input().split())
d = []
a = []
n_1=[i for i in range(1,n+1)]
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
a_1 = list(itertools.chain.from_iterable(a))
c=list(set(n_1)-set(a_1))
if len(c)>1:
  c=' '.join(c)
  print(c)
else:
  print(c[0])
Problem p02688 (python)

Fixed submission:
N, K = map(int, input().split())
d = []
A = []
setA = set(A)
ListN=[]
for i in range(1, N+1):
  ListN.append(i) 
setN = set(ListN) 

for i in range(K):
  d.append(input())
  setA = setA | set(list(map(int, input().split())))

print(len(setA^setN))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
d = []
A = []
ListN=[]
for i in range(1, N+1):
  ListN.append(i) 
setN = set(ListN) 

for i in range(K):
  d.append(input())
  A.append(list(map(int, input().split())))

for i in range(K-1):
  setA = set(A[i]) | set(A[i+1])



print(len(setA^setN))
Problem p02689 (python)

Fixed submission:
import numpy as np

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

h = {}
for k, v in zip(range(1,n+1),[k for k in map(int, input().split())]):
    h[k] = v 

miti = []
for i in range(m):
    temp = [k for k in map(int, input().split())]
    miti.append(temp)

x = np.zeros(n)

for i in range(m):
    if h[miti[i][0]] < h[miti[i][1]]:
        x[miti[i][0]-1] =+1
    elif h[miti[i][0]] > h[miti[i][1]]:
        x[miti[i][1]-1] =+1
    elif h[miti[i][0]] == h[miti[i][1]]:
        x[miti[i][0]-1] =+1
        x[miti[i][1]-1] =+1

print(sum(x == 0))

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

h = {}
for k, v in zip(range(1,n+1),[k for k in map(int, input().split())]):
    h[k] = v 

miti = []
for i in range(m):
    temp = [k for k in map(int, input().split())]
    miti.append(temp)

x = np.zeros(n)

for i in range(m):
    if h[miti[i][0]] < h[miti[i][1]]:
        x[miti[i][0]-1] =+1
    elif h[miti[i][0]] > h[miti[i][1]]:
        x[miti[i][1]-1] =+1
    elif h[miti[i][0]] == h[miti[i][1]]:
        x[miti[i][0]-1] =+1
        x[miti[i][1]-1] =+1

print(sum(x == 0))
Problem p03012 (python)

Fixed submission:
N = int(input())

W = list(map(int,input().split()))
s = []
for i in range (1, N + 1):
    a = W[:i]
    b = W[i:]
    s.append(abs(sum(a)-sum(b)))
print(min(s))

Buggy submission (verdict: Runtime Error):
N = int(input())
W = list(map(int,input().split()))
S = []
for i in range (1, N + 1):
    S.append((abs(sum(W[0: i+1])-sum(W[i+1:N+1])))
print(min(S))
Problem p03631 (python)

Fixed submission:
n = input()
if n[0] == n[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b , c, d = map(int, input().split())
if b <= c or d<=a:
    print(0)
elif b > c and b <= d:
    print(b-c)
elif c <= a and d<= b:
    print(d-a)
elif (d-c)>=(b-a):
    print(b-a)
elif (b-a)>= (d-c):
    print(d-c)
Problem p02701 (python)

Fixed submission:
import collections
n = int(input())
S = []
for _ in range(n):
    S.append(input()) 
print(len(collections.Counter(S)))

Buggy submission (verdict: Runtime Error):
import pandas as pd
n = int(input())
S = []
for _ in range(n):
    S.append(input()) 
df = pd.DataFrame(S)
print(len(pd.unique(df[0])))

Buggy submission (verdict: Runtime Error):
import pandas as pd
data = input().split()
df = pd.DataFrame(data)
print(len(pd.unique(df[0])))
Problem p02879 (python)

Fixed submission:
a, b = map(int, input().split())
if a < 10 and b < 10:
  print(a*b)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a < 10 and b < 10:
  print a*b
else:
  print -1

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if 0 < a < 10 & 0 < b < 10:
  print(a * b)
else:
  print -1
Problem p02897 (python)

Fixed submission:
s = float(input())
if (s % 2 == 0):
  print (s/(2*s))
else:
  print ((s+1)/(2*s))

Buggy submission (verdict: Runtime Error):
s = int(input())
if (s % 2 == 0):
  print (1/2)
else:
  print ((N-1) / 2N)
Problem p03072 (python)

Fixed submission:
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)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split))
count = 0
level = 0
for i in range(0, N):
    if H[i] > level:
        level = H[i]
        count += 1
return count
Problem p02688 (python)

Fixed submission:
import collections
N,K=map(int,input().split())
a=[]
d=[]
while K>0:
  K=K-1
  d.append(int(input()))
  b=list(map(int,input().split()))
  a.extend(b)
e=collections.Counter(a)
print(N-len(e))

Buggy submission (verdict: Runtime Error):
import collections
N,K=map(int,input().split())
while K>0:
  K=K-1
  d=int(input())
  a.append(map(str,input().split()))
e=collections.Counter(a)
p=N-len(e)
print(p)

Buggy submission (verdict: Runtime Error):
import collections
N,K=map(int,input().split())
a=[]
K=K+1
while K>0:
  K=K-1
  d=int(input())
  a.append(map(str,input().split()))
e=collections.Counter(a)
print(N-len(a))

Buggy submission (verdict: Runtime Error):
import collections
N,K=map(int,input().split())
a=[]
while K>0:
  K=K-1
  d=int(input())
  a.append(map(str,input().split())
e =collections.Counter(a)
print(N-len(e))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
a=[]
while K>0:
  d=int(input())
  b=list(map(int,input().split())
  a.extend(b)
  K=K-1
e=collection.Counter(a)
print(N-len(e))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
a=[]
while K>0:
  d=int(input())
  b=list(map(int,input().split())
  a.extend(b)
  K=K-1
e=collection.counter(a)
print(N-len(e))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
a=[]
while K>0:
  d=int(input())
  b=list(map(int,input().split())
  a.extend(b)
  K=K-1
collection.counter(a)
print(N-len(a))
Problem p02699 (python)

Fixed submission:
a,b=map(int,input().split())
if a<=b:
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a<=b:
  print(unsafe)
else:
  print(safe)
Problem p02701 (python)

Fixed submission:
import collections
N=int(input())
count=0
a=[]
while N>0:
  a.append(input())
  N=N-1
c=collections.Counter(a)
print(len(c))

Buggy submission (verdict: Runtime Error):
import collections
N=int(input())
count=0
a=[]
while N>0:
  a.append(input())
  N=N-1
c=collection.Counter(a)
print(len(c))
Problem p02753 (python)

Fixed submission:
S = input() 

if S.replace("A" ,"") == "" or S.replace("B", "") == "":
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
a = input()
Q = int(input())
Qy = [list(map(str,input().split())) for i in range(Q)]

for i in range(Q):
    if Qy[i][0] == "1":
        a = a[::-1]
    elif Qy[i][1] == "1":
        a = Qy[i][2] + a
    else :
        a += Qy[i][2]
print(a)
Problem p02711 (python)

Fixed submission:
S = input()
if '7' in S:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = input()
if '7' in S:
  print('Yes')
else
  print('No')
Problem p02759 (python)

Fixed submission:
n = int(input())
print(n // 2  + (n % 2))

Buggy submission (verdict: Runtime Error):
lines = sys.stdin.readlines()

digits = int(lines[0][0])

nums = [l.split() for l in lines[1:]]
result = ['0'] * digits

digit_set = set()
for num in nums:
    num_index = int(num[0])-1
    num_value = num[1]
    if num_index in digit_set and result[num_index] != num_value:
        print(-1)
        break
    digit_set.add(num_index)
    result[num_index] = num_value
else:
    if digits > 1 and result[0] == '0':
        print(-1)
    else:
        print(''.join(result))

Buggy submission (verdict: Runtime Error):
n = input()
print(n // 2  + (n % 2))

Buggy submission (verdict: Runtime Error):
n = input()
res = n // 2 
print(res + (res & 2))
Problem p02688 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

n, k = map(int, input().split())
a = np.zeros(n)

for i in range(k):
    d = input()
    temp = input()

    for j in range(int(d)):
        a[int(temp.split(' ')[j]) - 1] = 1

count = 0
for i in range(n):
    if a[i] == 0:
        count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np

n, k = map(int, input().split())
a = np.zeros(n)

for i in range(k):
    d = input()
    temp = input()

    for j in range(int(d)):
        a[int(temp[j*2]) - 1] = 1

count = 0
for i in range(n):
    if a[i] == 0:
        count = count + 1

print(count)
Problem p02699 (python)

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

if s <= w:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int,input().split())


if -(-c // b) <= -(-a // d):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s,w = map(int,input().split())

if s =< w:
    print('unsafe')
elif s > w:
    print('safe')

Buggy submission (verdict: Runtime Error):
s,w = map(int,input().split())

if s > w:
    print('safe')
elif s =< w:
    print('unsafe')
Problem p02701 (python)

Fixed submission:
import collections
n = int(input())
a = [input() for i in range(n)]
list_a = list(a)
c = collections.Counter(a)

print(len(c))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [input().split() for i in range(n)]

c = collections.counter(a)

print(len(c))

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

c = collections.counter(a)

print(len(c))
Problem p02711 (python)

Fixed submission:
n = input()
ans = 'No'
for i in n:
    if i == '7':
        ans = 'Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
if '7' in N:
    print('Yes')
else:
    print('No')
Problem p02835 (python)

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

if a + b + c >= 22:
    print('bust')
else:
    print('win')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())

if sum(a,b,c) >= 22:
    print('bust')
else:
    print('win')