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

Fixed submission:
s1, s2, s3  =raw_input().split()
print((s1[0]+s2[0]+s3[0]).upper())

Buggy submission (verdict: Runtime Error):
A=int(raw_input())
B=int(raw_input())
if (A>B):
 print('GREATER')
elif(A==B):
 print('EQUAL')
else:
 print('LESS')

Buggy submission (verdict: Runtime Error):
A=int(raw_input())
B=int(raw_input())
if (A>B):
 print('GREATER')
elif(A==B):
 print('EQUAL')
else:
 print('LESS')
#print((s1[0]+s2[0]+s3[0]).upper())
Problem p03737 (python)

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

fullstr = raw_input()

sf = ['','','']

sf[0] = fullstr[0]
num = 1

for i in range(len(fullstr)):
  if (fullstr[i] == ' '):
    sf[num] = fullstr[i+1]
    num += 1

print '%s%s%s' % (sf[0].upper(), sf[1].upper(), sf[2].upper())

Buggy submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-

n = int(raw_input())
numlist = (raw_input()).split(' ')

sumlist = [int(numlist[0])]
count = 0

for i in range(1, n):
  sumlist.append(sumlist[i-1] + int(numlist[i]))
  while (True):
    if (sumlist[i-1] > 0 and sumlist[i] > 1):  #i-1,i番目までのsumがともに正
      numlist[i] = int(numlist[i]) - 1
      sumlist[i] -= 1
      count += 1
    elif (sumlist[i-1] < 0 and sumlist[i] < 0):  #i-1,i番目までのsumがともに負
      numlist[i] = int(numlist[i]) + 1
      sumlist[i] += 1
      count += 1
    elif (sumlist[i] == 0):  #i番目までのsum=0
      if (sumlist[i-1] > 0):
        numlist[i] = int(numlist[i]) - 1
        sumlist[i] -= 1
      if (sumlist[i-1] < 0):
        numlist[i] = int(numlist[i]) + 1
        sumlist[i] += 1
      count += 1
    else:
      break

print count

Buggy submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-

sA = raw_input()
sB = raw_input()

A = int(sA)
B = int(sB)

if (A > B):
  print 'GREATER'
elif (A < B):
  print 'LESS'
else:
  print 'EQUAL'
Problem p03738 (python)

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

sA = raw_input()
sB = raw_input()

A = int(sA)
B = int(sB)

if (A > B):
  print 'GREATER'
elif (A < B):
  print 'LESS'
else:
  print 'EQUAL'

Buggy submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-

n = int(raw_input())
numlist = (raw_input()).split(' ')

count = 0

i = 0
while (int(numlist[i]) == 0):
 i += 1

if (int(numlist[0]) == 0):
    if (int(numlist[i]) > 0):
        numlist[0] = (-1) ** i
    else:
        numlist[0] = (-1) ** (i+1)
    count += 1

sumlist = [int(numlist[0])]

for i in range(1, n):
  sumlist.append(sumlist[i-1] + int(numlist[i]))
  while (True):
    if (sumlist[i-1] > 0 and sumlist[i] > 0):  #i-1,i番目までのsumがともに正
      numlist[i] = int(numlist[i]) - (sumlist[i] + 1)
      count += sumlist[i] + 1
      sumlist[i] = -1
    elif (sumlist[i-1] < 0 and sumlist[i] < 0):  #i-1,i番目までのsumがともに負
      numlist[i] = int(numlist[i]) + ((-1)*sumlist[i] + 1)
      count += (-1)*sumlist[i] + 1
      sumlist[i] = 1
    elif (sumlist[i] == 0):  #i番目までのsum=0
      if (sumlist[i-1] > 0):
        numlist[i] = int(numlist[i]) - 1
        sumlist[i] -= 1
      if (sumlist[i-1] < 0):
        numlist[i] = int(numlist[i]) + 1
        sumlist[i] += 1
      count += 1
    else:
      break
    #print numlist
    #print sumlist

print count

Buggy submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-

sA = raw_input()
sB = raw_input()

A = int(sA)
B = int(sB)

if (A > B):
  print 'GREATER'
elif (A < B):
  print 'LESS'
else:
  print 'EQUAL'
~
Problem p03742 (python)

Fixed submission:
x,y=map(int,raw_input().split())

if abs(x-y)<=1:
	print "Brown"
else:
	print "Alice"

Buggy submission (verdict: Runtime Error):
x,y=map(int,raw_input().split())

if abs(x,y)<=1:
	print "Brown"
else:
	print "Alice"
Problem p03737 (python)

Fixed submission:
print("".join([s[0].upper() for s in input().split()]))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
 
if a == b:
 print("EQUEAL")
elif a > b:
 print("GREATER")
else:
 print("LESS")

Buggy submission (verdict: Runtime Error):
a = input()
b = input()

if a == b:
 print("EQUEAL")
elif a > b:
 print("GREATER")
else:
 print("LESS")
Problem p03737 (python)

Fixed submission:
a = input()
a = a.upper()
b = a.split()

s = b[0]
s = s[0]
t = b[1]
t = t[0]
r = b[2]
r = r[0]

q = s + t + r
print (q)

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

i = i.split()
for item in range(len(i)):
    i[item] = int(i[item])

totn = 0
totp = 0

countp = 0
countn = 0

for x in range(len(i)):
    totp += i[x]
    totn += i[x]

    if x %2 == 1:
        if totn == 0:
            countn += 1
            totn = 1
        elif totn < 0:
            countn += abs(totn) + 1
            totn = 1

        if totp == 0:
            countp += 1
            totp = -1
        elif totp > 0:
            countp += abs(totp) + 1
            totp = -1

    if x %2 == 0:
        if totn == 0:
            countn += 1
            totn = -1
        elif totn > 0:
            countn += abs(totn) + 1
            totn = -1

        if totp == 0:
            countp += 1
            totp = 1
        elif totp < 0:
            countp += abs(totp) + 1
            totp = 1
count = min(countn, countp)
print(count)
Problem p03737 (python)

Fixed submission:
def a(inp):
    sts = inp.split(' ')
    ans = [s[0].upper() for s in sts]
    print(''.join(ans))

a(input())

Buggy submission (verdict: Runtime Error):
def c(ints):
    
    for i in range(len(ints)):
        if ints[i] != 0:
            sig = 1 if ints[i] > 0 else -1
            total = ints[i]
            mov = i + 1
            j = i
            break
        if i == len(ints) - 1:
            return i + 1
    
    for i_ in ints[j+1:]:
        tmp = total + i_
        if tmp == 0:
            mov +=1
            tmp = -sig
            
        elif sig * tmp > 0:
            mov += abs(tmp) + 1
            tmp = -sig
            
        sig *= -1
        total = tmp
        
    return mov

_ = input()
inp = input()
inp = inp.split(' ')
inp = [int(i_) for i_ in inp]
print(c(inp))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if a > b:
    print('GREATER')
elif b > a:
    print('LESS')
else:
    print('EQUAL')
Problem p03777 (python)

Fixed submission:
a,b = input().split()
if a == b:
     print('H')
else:
     print('D')

Buggy submission (verdict: Runtime Error):
def whatIsMinNumber(X_copy,K):
    pickupNum = X_copy[len(X_copy)//2]
    X_rest = X[:]
    X_rest.remove(pickupNum)
    if can_do_number(X_rest,0,K-pickupNum,K-1):
        if len(X_copy) > 2:
            return whatIsMinNumber(X_copy[len(X_copy)//2+1:len(X_copy)],K)
        else:
            return pickupNum
    else:
        if len(X_copy) > 1:
            return whatIsMinNumber(X_copy[0:len(X_copy)//2],K)
        else:
            return pickupNum+1

def can_do_number(X,sum,min,max):
    if len(X) == 0:
        return False
    for i in range(0,len(X)):
        if min <= sum+X[i] <= max:
            return True
        elif min > sum+X[i]:
            X_rest = X[:]
            sum = sum + X_rest.pop(i)
            can_do_number(X_rest,sum,min,max)
        else:
            pass
    return False

N,K = list(map(int, input().split()))
X = list(map(int, input().split()))
X = [6,20,10,4,3,10,25,2]
N = X.pop(0)
K = X.pop(0)
X.sort(reverse = True)
thenum = whatIsMinNumber(X[:],K)
print(len(list(filter((lambda x:x<whatIsMinNumber(X[:],K)),X))))

Buggy submission (verdict: Runtime Error):
def whatIsMinNumber(X_copy,K):
    pickupNum = X_copy[len(X_copy)//2]
    X_rest = X[:]
    X_rest.remove(pickupNum)
    if can_do_number(X_rest,pickupNum,K,K+pickupNum-1):
        if len(X_copy) > 2:
            return whatIsMinNumber(X_copy[len(X_copy)//2+1:len(X_copy)],K)
        else:
            return pickupNum
    else:
        if len(X_copy) > 1:
            return whatIsMinNumber(X_copy[0:len(X_copy)//2],K)
        else:
            return pickupNum+1

def can_do_number(X,sum,min,max):
    #残りのカードがない場合はFalseを返す
    if len(X) == 0:
        return False
    #残りのカードで順番に調べる
    for i in range(0,len(X)):
        if min <= sum+X[i] <= max:
            return True
        elif min > sum+X[i]:
            X_rest = X[:]
            sum = sum + X_rest.pop(i)
            can_do_number(X_rest,sum,min,max)
        else:
            pass
    return False

N,K = list(map(int, input().split()))
X = list(map(int, input().split()))
X.sort(reverse = True)
thenum = whatIsMinNumber(X[:],K)
print(len(list(filter((lambda x:x<thenum),X))))

Buggy submission (verdict: Runtime Error):
X = int(input())
P = {0}
i=1
while True:
    Q = {0}
    for p in P:
        Q.add(p+i)
        Q.add(p-i)
    P = P.union(Q)
    if X in P:
        print(i)
        break
    i = i+1
Problem p03741 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 10 ** 100
p = lambda x, y: x * y >= 0
po = lambda x, y: abs(x + y) + 1 if p(x, x + y) else 0
popo = lambda x, y: -1 * x // abs(x) if p(x, x + y) else x + y


if a[0] == 0:
    s = [1, -1]
    tmpAns = [1, 1]
    for (_s, _ans) in zip(s, tmpAns):
        for i in range(1, n):
            _ans +=  po(_s, a[i])
            _s = popo(_s, a[i])
        ans = min((ans, _ans))
else:
    s = [a[0], -1 * a[0] // abs(a[0])]
    tmpAns = [0, abs(a[0]) + 1]
    for (_s, _ans) in zip(s, tmpAns):
        for i in range(1, n):
            _ans +=  po(_s, a[i])
            _s = popo(_s, a[i])
        ans = min((ans, _ans))

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = a[0]
ans = 0
for i in range(1, n):
    ans +=  abs(s + a[i]) + 1 if s * (s + a[i]) >= 0 else 0
    s = -1 * s // abs(s) if s * (s + a[i]) >= 0 else s + a[i]

print(ans)
Problem p03992 (python)

Fixed submission:
s = input()
s = s[:4] + ' ' + s[4:]
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
cnt = 0
for i in range(n):
    if i == l[l[i] - 1] - 1:
        cnt+=1
cnt //= 2
print(cnt)

Buggy submission (verdict: Runtime Error):
    s = input()
    s = s[:4] + ' ' + s[4:]
    print(s)

Buggy submission (verdict: Runtime Error):
s = input()
s = s[:4] + '  ' s[4:]
print(s)
Problem p03930 (python)

Fixed submission:
def main():
    h, w, k = map(int, raw_input().split())
    c = [map(int, raw_input().strip()) for _ in xrange(h)]
    def go(a):
        if not res:
            return 0
        return go(a) * 2 + res
    ans = 0
    for ii in xrange(h):
        for jj in xrange(w):
            a = [c[i][:] for i in xrange(h)]
            a[ii][jj] = 0
            r = 0
            e = 1
            while 1:
                for j in xrange(w):
                    st = [a[i][j] for i in xrange(h) if a[i][j]]
                    for i in xrange(h):
                        a[i][j] = 0
                    i = -1
                    for x in reversed(st):
                        a[i][j] = x
                        i -= 1
                res = 0
                for i in xrange(h):
                    j = 0
                    while j < w:
                        t = j + 1
                        while t < w and a[i][j] == a[i][t]:
                            t += 1
                        if t - j >= k:
                            for j in xrange(j, t):
                                res += a[i][j]
                                a[i][j] = 0
                        j = t
                if not res:
                    break
                r += res * e
                e *= 2
            if ans < r:
                ans = r
    print ans
main()

Buggy submission (verdict: Runtime Error):
def main():
    h, w, k = map(int, raw_input().split())
    c = [map(int, raw_input().strip()) for _ in xrange(h)]
    def go(a):
        if not res:
            return 0
        return go(a) * 2 + res
    ans = 0
    for ii in xrange(h):
        for jj in xrange(w):
            a = [c[i][:] for i in xrange(h)]
            a[ii][jj] = 0
            r = 0
            e = 1
            while res:
                for j in xrange(w):
                    st = [a[i][j] for i in xrange(h) if a[i][j]]
                    for i in xrange(h):
                        a[i][j] = 0
                    i = -1
                    for x in reversed(st):
                        a[i][j] = x
                        i -= 1
                res = 0
                for i in xrange(h):
                    j = 0
                    while j < w:
                        t = j + 1
                        while t < w and a[i][j] == a[i][t]:
                            t += 1
                        if t - j >= k:
                            for j in xrange(j, t):
                                res += a[i][j]
                                a[i][j] = 0
                        j = t
                if not res:
                    break
                r += res * e
                e *= 2
            if ans < r:
                ans = r
    print ans
main()
Problem p03752 (python)

Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = float("inf")
 
for i in range(2**n):
    highest = a[0]
    color = 1
    money = 0
    for j in range(1,n):
        if a[j] > highest:
            color += 1
            highest = a[j]
        elif (i>>j)&1:
            color += 1
            highest = highest + 1
            money += highest - a[j]
        
    if color >= k:
        ans = min(ans,money)
print(ans)

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
// #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>

using namespace std;
typedef long long ll;

#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,a,b) for(int i=(a);i<(b);i++)

template<class T> inline void chmin(T& a, T b) {if (a > b) a = b;}
template<class T> inline void chmax(T& a, T b) {if (a < b) a = b;}
const ll inf = 1LL<<60;

int main() {
  int n,k,high;cin>>n>>k;
  ll ans=inf;
  ll now=0;
  int color=0;

  vector<int> a(n);
  rep(i,n){
    cin>>a[i];
  }
  for(int i=0;i<(1<<n);i++){
    high=a[0];
    color=1;
    now=0;
    for(int j=1;j<n;j++){
      if(1 & (i>>j)){
        if(a[j]<=high){
          now+=high-a[j]+1;
          high=high+1;
          color+=1;
        }else{
          color+=1;
        }
      }else{
        if(high<a[j]){
          high=a[j];
          color+=1;
        }
      }
    }
    if(k<=color){
      ans=min(ans,now);
    }
  }
  cout<<ans<<endl;
}
Problem p03910 (python)

Fixed submission:
# CODE FESTIVAL 2016 Final
# B - Exactly N points
# https://atcoder.jp/contests/cf16-final/tasks/codefestival_2016_final_b
N = int(input())
for i in range(1, N+1):
    if i*(i+1)//2 >= N:
        k = i
        break


S = k*(k+1)//2
sub = S-N
for i in range(1, k+1):
    if i == sub:
        continue
    print(i)
1

Buggy submission (verdict: Runtime Error):
# CODE FESTIVAL 2016 Final
# B - Exactly N points
# https://atcoder.jp/contests/cf16-final/tasks/codefestival_2016_final_b
N = int(input())
for i in range(1, N):
    if i*(i+1)//2 >= N:
        k = i
        break

S = k*(k+1)//2
sub = S-N
for i in range(1, k+1):
    if i == sub:
        continue
    print(i)
Problem p03752 (python)

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

ans = 1145141919810364364334
for i in range(1,2**n):
    ls = [0] * n
    qq = []
    
    for j in range(n):
        if (i >> j) & 1:
            ls[j] = 1
            qq.append(j)
            
    if sum(ls) < k:
        continue
        
    else:
        mt = a[0]
        cost = 0
        for j in range(1,n) :
            if mt < a[j]:
                mt = a[j]
            else:
                if ls[j] == 1:
                    cost += mt + 1 - a[j]
                    mt += 1
    ans = min(ans,cost)
    
print(ans)

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

ans = 1145141919810364364334
for i in range(1,2**n):
    ls = [0] * n
    qq = []
    
    for j in range(n):
        if (i >> j) & 1:
            ls[j] = 1
            qq.append(j)
            
    if sum(ls) < k:
        continue
        
    elif ls[0] == 1:
        t = []
        for j in qq:
            t.append(a[j])
        
        mt = t[0]
        cost = 0
        for j in range(len(qq) - 1) :
            if t[j+1] <= mt:
                cost += (mt + 1 - t[j+1])
                mt += 1
            else:
                mt = max(t[j+1] ,a[:qq[j+1]])
    else:
        continue
                
    ans = min(ans,cost)
    
print(ans)
Problem p03760 (python)

Fixed submission:
O = input()
E = input()

K = len(E)

String = ""

for i in range(K):
    
    String += O[i]
    String += E[i]

if len(O)>len(E):
    String += O[-1]

print(String)

Buggy submission (verdict: Runtime Error):
O = input()
E = input()

K = len(O)
String = ""

for i in range(K):
    
    String += O[i]
    String += E[i]

print(String)
Problem p03759 (python)

Fixed submission:
a,b,c=map(int,input().split())
if b-a==c-b:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input()split())
if b-a==c-b:
  print('YES')
else:
  print('NO')
Problem p03773 (python)

Fixed submission:
tmp = input().split()
a, b = int(tmp[0]), int(tmp[1])

s = a + b

if s < 24:
    print(s)
else:
    print(s-24)

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

a = []
b = []

for i in range(n):
    tmp1, tmp2 = list(map(int, input().split()))
    a.append(tmp1)
    b.append(tmp2)

c = []
d = []

for i in range(m):
    tmp1, tmp2 = list(map(int, input().split()))
    c.append(tmp1)
    d.append(tmp2)

for i in range(n):
    tmp = abs(a[n] - c[0]) + abs(b[n] - d[0])
    s = 1
    for j in range(m):
        tmp3 = abs(a[i] - c[j]) + abs(b[i] - d[j])
        if tmp3 < tmp:
            tmp = tmp3
            s = j + 1
    print(s)
Problem p03759 (python)

Fixed submission:
a, b, c = map(int, raw_input().split())
print 'YES' if b - a == c - b else 'NO'

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, raw_input().split())
print 'YES' if b - a = c - b else 'NO'
Problem p03760 (python)

Fixed submission:
import itertools
O = raw_input()
E = raw_input()
seq = []
for x, y in itertools.izip_longest(O, E):
    if x: seq.append(x)
    if y: seq.append(y)
print ''.join(seq)

Buggy submission (verdict: Runtime Error):
import itertools
O, E = raw_input().split()
seq = []
for x, y in itertools.izip_longest(O, E):
    if x: seq.append(x)
    if y: seq.append(y)
print ''.join(seq)
Problem p03777 (python)

Fixed submission:
inp = raw_input().split()

if inp[0] == 'H': print 'H' if inp[1] == 'H' else 'D'
else: print 'H' if inp[1] == 'D' else 'D'

Buggy submission (verdict: Runtime Error):
if raw_input() == 'H': print 'H' if raw_input() == 'H' else 'D'
else: print 'H' if raw_input() == 'D' else 'D'

Buggy submission (verdict: Runtime Error):
if raw_input() == 'H': print raw_input() == 'H'
else: print raw_input() == 'D'
Problem p03759 (python)

Fixed submission:
d=input().split()
a=int(d[0])
b=int(d[1])
c=int(d[2])



if b-a==c-b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
d=input().split()
a=int(d[1])
b=int(d[2])
c=int(d[3])



if b-a==c-b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())

if a-b==c-b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())

if a-b=c-b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
if a-b=c-b:
    print("YES")
else:
    print("NO")
Problem p03760 (python)

Fixed submission:
a=list(input())
b=list(input())
d=""
for i in range(0,len(b)):
    c=a[i]+b[i]
    d=d+c

if len(b)+1 == len(a):
    d = d+ a[len(a)-1]

print(d)

Buggy submission (verdict: Runtime Error):
a=list(input())
b=list(input())
d=""
for i in range(0,len(b)):
    c=a[i]+b[i]
    d=d+c
    if len(b)+1 == len(a):
        d = d+ a[len(a)]
print(d)

Buggy submission (verdict: Runtime Error):


a=list(input())
b=list(input())
d=""
for i in range(0,len(a)):
    c=a[i]+b[i]
    d=d+c
print(d)

Buggy submission (verdict: Runtime Error):


a=list(input())
b=list(input())
d=""
for i in range(0,len(a)):
    c=a[i]+b[i]
    d=d+c
print("d")

Buggy submission (verdict: Runtime Error):
import numpy as np

a=list(input))
b=list(input))
c=[]
for i in range(0,len(a)+len(b)):
    c=np.append(c,a[i]+b[i],axis=0)
print("c")
Problem p03759 (python)

Fixed submission:
a, b, c = map(int, input().split())
if (b-a) == (c-b):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, raw_input().split())
if (b-a) == (c-b):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, raw_input().split())
2.2.if (b-a) == (c-b):
3.3.    print("YES")
4.4.else:
5.5.    print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, raw_input().split())
2.if (b-a) = (c-b):
3.    print("YES")
4.else:
5.    print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, raw_input().split())
if (b-a) or (c-b):
    print("YES")
else:
    print("NO")
Problem p03761 (python)

Fixed submission:
import sys
import numpy as np
import string

N = int(input())
S = [input() for i in range(N)]

dict = string.ascii_lowercase#abc...xyz

data_list = np.zeros((N,26))

for i in range(0,N):
	list = []
	for j in range(0,26):
		list.append(S[i].count(str(dict[j])))
	data_list[i] = np.array(list)
data_min = data_list.min(axis = 0)

a = np.nonzero(data_min)
size = np.nonzero(data_min)[0].size
b = a[0]
kotae = ""
for i in range(size):
	Moji = dict[b[i]]*int(data_min[b[i]])
	kotae = kotae + Moji
	pass
print(kotae)

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
import string

N = int(input())
S = [input() for i in range(N)]

dict = string.ascii_lowercase#abc...xyz

data_list = np.zeros((N,26))

for i in range(0,N):
	list = []
	for j in range(0,26):
		list.append(S[i].count(str(dict[j])))
	data_list[i] = np.array(list)
data_min = data_list.min(axis = 0)

del list
gc.collect()

a = np.nonzero(data_min)
size = np.nonzero(data_min)[0].size
b = a[0]
kotae = ""
for i in range(size):
	Moji = dict[b[i]]*int(data_min[b[i]])
	kotae = kotae + Moji
	pass
del data_min
gc.collect()

print(kotae)
Problem p03777 (python)

Fixed submission:
import sys

a, b = (i for i in input().split(" "))

#if a == "H" and b == "H" or a == "D" and b = "D":
if a ==  b:
	print("H")
else:
	print("D")

Buggy submission (verdict: Runtime Error):
a, b = (int(i) for i in input().split())

#if a == "H" and b == "H" or a == "D" and b = "D":
if a ==  b
	return "H"
else:
	return "D"
Problem p03779 (python)

Fixed submission:
import sys

X = int(input())

if X == 1:
	print(1)
elif X > 1:
	for i in range(2,1000000000):
		if X <= i*(i + 1)/2:
			t = i
			print(i)
			break

Buggy submission (verdict: Runtime Error):
import sys

X = int(input())

if X == 1:
	print(1)
elif X > 1:
	for i in range(2,1000000000):
		if X <= i*(i + 1)/2:
			t = i
			break
print(i)

Buggy submission (verdict: Runtime Error):
import sys

X = int(input())

if X == 1:
	print(1)
elif X > 1:
	for i in range(2,100000):
		if X <= i*(i + 1)/2:
			t = i
			break
print(i)
Problem p03760 (python)

Fixed submission:
o = input()
e = input()
r = ''

for i in range(len(o)):
  r += o[i]
  if i < len(e):
    r += e[i]
print(r)

Buggy submission (verdict: Runtime Error):
o = input()
e = input()
r = ''

for i in range(len(o)):
  r += o[i]
  if i < len(e)
    r += e[i]
print(r)