ZhenlongDai/ACPR huggingface dataset:
Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def diff(a, b, c):
    i = 0
    for aa, bb, cc in zip(a, b, c):
        if aa != bb or aa != cc:
            i += 1
    return i

n = int(input())
a = list(input())
b = list(input())
c = list(input())

print(diff(a, b, c))

Failing test case input:
7
tkojzen
tjuosss
gromrp`

Expected output:
12


Actual output:
7


Fixed submission (verdict: Accepted):
def diff(a, b, c):
    i = 0
    for aa, bb, cc in zip(a, b, c):
        if aa != bb and aa != cc and bb != cc:
            i += 2
        elif aa != bb or bb != cc:
            i += 1
    return i

n = int(input())
a = list(input())
b = list(input())
c = list(input())

print(diff(a, b, c))

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(input())
b=list(input())
c=list(input())

print(a,b,c)

ans=0

for i in range(n):

    s=[a[i],b[i],c[i]]
    buff=set(s)
    ans += len(buff)-1

print(ans)

Failing test case input:
7
ukoknez
tnuitsu
program

Expected output:
13


Actual output:
['u', 'k', 'o', 'k', 'n', 'e', 'z'] ['t', 'n', 'u', 'i', 't', 's', 'u'] ['p', 'r', 'o', 'g', 'r', 'a', 'm']
13


Fixed submission (verdict: Accepted):
n=int(input())
a=list(input())
b=list(input())
c=list(input())

ans=0

for i in range(n):

    s=[a[i],b[i],c[i]]
    buff=set(s)
    ans += len(buff)-1

print(ans)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = input()
B = input()
C = input()
if A == B == C:
    print(0)

count = 0
for a, b, c in zip(A,B,C):
    if a == b == c:
        pass
    elif a == b and not a==c:
        count += 1
    elif a ==c and not a == b:
        count += 1
    elif b == c and not a == b:
        count += 1
    else:
        count += 2
print(count)

Failing test case input:
9
different
different
different

Expected output:
0

Actual output:
0
0


Fixed submission (verdict: Accepted):
N = int(input())
A = input()
B = input()
C = input()
if A == B == C:
    print(0)
else:
    count = 0
    for a, b, c in zip(A,B,C):
        if a == b == c:
            pass
        elif a == b and not a==c:
            count += 1
        elif a ==c and not a == b:
            count += 1
        elif b == c and not a == b:
            count += 1
        else:
            count += 2
    print(count)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = input().strip()
b = input().strip()
c = input().strip()
ans = 0
for _a, _b, _c in zip(a, b, c):
  if _a != _b and _b != _c:
    ans += 2
  elif _a == _b and _b == _c:
    continue
  else:
    ans += 1
print(ans)

Failing test case input:
4
west
east
wait

Expected output:
3

Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
a = input().strip()
b = input().strip()
c = input().strip()
ans = 0
for _a, _b, _c in zip(a, b, c):
  if _a != _b and _b != _c and _a != _c:
    ans += 2
  elif _a == _b and _b == _c:
    continue
  else:
    ans += 1
print(ans)
Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = input()
B = input()
C = input()

a = list(A)
b = list(B)
c = list(C)

ans = 0

for i in range(N):
    if a[i] == b[i] or a[i] == c[i] or b[i] == c[i]:
        ans += 1
    elif a[i] == b[i] == c[i]:
        pass
    else:
        ans += 2

print(ans)

Failing test case input:
9
different
different
different

Expected output:
0

Actual output:
9


Fixed submission (verdict: Accepted):
N = int(input())
A = input()
B = input()
C = input()

a = list(A)
b = list(B)
c = list(C)

ans = 0

for i,j in enumerate(a):
    if j == b[i] or j == c[i] or b[i] == c[i]:
        if j == b[i] == c[i]:
            continue
        ans += 1
    elif a[i] != b[i] != c[i]:
        ans += 2
    

print(ans)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
  if a[i]==b[i]:
    if not b[i]==c[i]:
      ans+=1
  else:
    if b[i]==c[i]:
      ans+=1
    else:
      ans+=2
print(ans)

Failing test case input:
4
wetu
`est
wait

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
  if a[i]==b[i]:
    if not b[i]==c[i]:
      ans+=1
  else:
    if b[i]==c[i]:
      ans+=1
    elif a[i]==c[i]:
      ans+=1
    else:
      ans+=2
print(ans)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, a, b, c = [input() for i in range(4)]
n = int(n)

ret = 0
for i in range(n):

    if (a[i] == b[i]) and (a[i] == c[i]):

        pass
    elif (a[i] == b[i]) and (a[i] != c[i]):

        c = c[:i] + a[i] + c[i + 1:]
        ret += 1

    elif a[i] == c[i] and a[i] != b[i]:
        b = b[:i] + a[i] + b[i + 1:]
        ret += 1

    elif a[i] != b[i] and a[i] != c[i]:
        b = b[:i] + a[i] + b[i + 1:]
        c = c[:i] + a[i] + c[i + 1:]
        ret += 2


print(ret)


Failing test case input:
9
bigredent
bifrfefnt
tddfmtfhe

Expected output:
12


Actual output:
13


Fixed submission (verdict: Accepted):
n, a, b, c = [input() for i in range(4)]
n = int(n)

ret = 0
for i in range(n):
    if (a[i] == b[i]) and (a[i] == c[i]):
        pass

    elif (a[i] == b[i]) and (a[i] != c[i]):
        c = c[:i] + a[i] + c[i + 1:]
        ret += 1

    elif a[i] == c[i] and a[i] != b[i]:
        b = b[:i] + a[i] + b[i + 1:]
        ret += 1

    elif a[i] != c[i] and b[i] == c[i]:
        a = a[:i] + b[i] + a[i + 1:]
        ret += 1

    elif a[i] != b[i] and a[i] != c[i]:
        b = b[:i] + a[i] + b[i + 1:]
        c = c[:i] + a[i] + c[i + 1:]
        ret += 2


print(ret)
Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = input()
b = input()
c = input()

count = 0

for i in range(n):
    if a[i] != b[i] and a[i] != c[i]:
        count += 2
    elif a[i] != b[i] or a[i] != c[i]:
        count += 1
        
print(count)

Failing test case input:
9
aigredent
bifreefnt
teefmsfhd

Expected output:
12


Actual output:
13


Fixed submission (verdict: Accepted):
n = int(input())
a = input()
b = input()
c = input()
 
count = 0
 
for i in range(n):
    if a[i] != b[i] and b[i] == c[i]:
        count += 1
    elif a[i] != b[i] and a[i] != c[i]:
        count += 2
    elif a[i] != b[i] or a[i] != c[i]:
        count += 1
        
print(count)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(input())
B = list(input())
C = list(input())

ans = 0
for a,b,c in zip(A, B, C):
    if a == b and b == c:
        continue
    elif a != b and b != c and a != c:
        ans += 3
    else:
        ans += 1

print(ans)

Failing test case input:
7
neyjokt
tjuosss
gromrqa

Expected output:
14


Actual output:
21


Fixed submission (verdict: Accepted):
N = int(input())
A = list(input())
B = list(input())
C = list(input())

ans = 0
for a,b,c in zip(A, B, C):
    if a == b and b == c:
        continue
    elif a != b and b != c and a != c:
        ans += 2
    else:
        ans += 1

print(ans)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=input()
b=input()
c=input()
count=0
for i in range(n):
    if a[i]==b[i] and b[i]==c[i]:
        continue
    elif a[i]==b[i] or c[i]==b[i] or a[i]==c[i]:
        count += 1
    else:
        count += 2

Failing test case input:
4
wetv
`est
tiaw

Expected output:
7


Actual output:

Fixed submission (verdict: Accepted):
n=int(input())
a=input()
b=input()
c=input()
count=0
for i in range(n):
    if a[i]==b[i] and b[i]==c[i]:
        continue
    elif a[i]==b[i] or c[i]==b[i] or a[i]==c[i]:
        count += 1
    else:
        count += 2
print(count)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = []
for i in range(3):
    a.append(input())

ans = 0
for i in range(N):
    if a[0][i] != a[1][i] and a[1][i] != a[2][i]:
        ans += 2
    elif a[0][i] == a[1][i] and a[1][i] == a[2][i]:
        continue
    else:
        ans += 1
print(ans)

Failing test case input:
4
wetv
`ett
wait

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
a = []
for i in range(3):
    a.append(input())

ans = 0
for i in range(N):
    if a[0][i] != a[1][i] and a[1][i] != a[2][i] and a[0][i] != a[2][i]:
        ans += 2
    elif a[0][i] == a[1][i] and a[1][i] == a[2][i] and a[0][i] == a[2][i]:
        continue
    else:
        ans += 1
print(ans)
Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def data_input():
    a = input()
    b = input()
    c = input()
    d = input()
    return (int(a),b,c,d)
def answer():
    n,a,b,c = data_input()
    counta = 0
    countb = 0
    countc = 0
    for i in range(n):
        if a[i] != b[i]:
            counta += 1
    for i in range(n):
        if a[i] != c[i]:
            countb += 1
    for i in range(n):
        if b[i] != c[i]:
            countc += 1
    return counta + countb + countc - max(counta,countb,countc)

def output():
    res = answer()
    print(res)
output()

Failing test case input:
4
wetu
`est
w`it

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
def data_input():
    a = input()
    b = input()
    c = input()
    d = input()
    return (int(a),b,c,d)
def answer():
    n,a,b,c = data_input()
    counta = 0
    for i in range(n):
        count = 0
        if a[i] != b[i]:
            count += 1
        if a[i] != c[i]:
            count += 1
        if b[i] != c[i]:
            count += 1
        if count != 0:
            count -= 1
        counta += count

    return counta

def output():
    res = answer()
    print(res)
output()

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = input()
B = input()
C = input()
count = 0
for i in range(N):
	
	if A[i] != B[i]:
		count+=1
		if A[i] != C[i]:
			count+=1

	elif A[i] != C[i]:
		count+=1

print(count)

Failing test case input:
9
tnedergia
cifreefnt
difsmfeet

Expected output:
14


Actual output:
17


Fixed submission (verdict: Accepted):
N = int(input())
A = input()
B = input()
C = input()
count = 0
for i in range(N):
	
	if A[i] != B[i]:
		count+=1
		if A[i] != C[i] and B[i] != C[i]:
			count+=1

	elif A[i] != C[i]:
		count+=1

print(count)

Problem: p03140
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
a = input()
b = input()
c = input()
cnt = [0,0,0]
for i in range(n):
    c1,c2,c3=0,0,0

    if b[i] !=a[i] :
        c1=1

    if c[i]!=b[i]:
        c2=1
    if c[i]!=a[i]:
        c3=1

    cnt[0] +=c1+c3
    cnt[1] +=c2+c3
    cnt[2] +=c1+c2

print(min(cnt))


Failing test case input:
9
tnedergia
bifreefnt
teefmsfhd

Expected output:
14


Actual output:
15


Fixed submission (verdict: Accepted):
n = int(input())
a = input()
b = input()
c = input()
cnt = 0
for i in range(n):
    c1,c2,c3=0,0,0

    if b[i] ==a[i] and c[i]==b[i]:
        pass

    elif b[i] ==a[i] or c[i]==b[i] or c[i] ==a[i]:

        cnt+=1
    else:
        cnt+=2

print(cnt)
Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=input()
b=input()
c=input()
abc=list('0'*n)
for i in range(n):
    if a[i]==b[i]:
        abc[i]=a[i]
    if b[i]==c[i]:
        abc[i]=b[i]
    if c[i]==a[i]:
        abc[i]=c[i]
count=0
for i in range(n):
    if a[i]!=abc[i]:
        count+=1
    if b[i]!=abc[i]:
        count+=1
    if c[i]!=abc[i]:
        count+=1
print(count)

Failing test case input:
4
vext
`sgt
vjbs

Expected output:
6


Actual output:
8


Fixed submission (verdict: Accepted):
n=int(input())
a=input()
b=input()
c=input()
abc=list('0'*n)
for i in range(n):
    if a[i]==b[i]:
        abc[i]=a[i]
    if b[i]==c[i]:
        abc[i]=b[i]
    if c[i]==a[i]:
        abc[i]=c[i]
    if abc[i]=='0':
        abc[i]=a[i]
count=0
for i in range(n):
    if a[i]!=abc[i]:
        count+=1
    if b[i]!=abc[i]:
        count+=1
    if c[i]!=abc[i]:
        count+=1
print(count)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = input()
b = input()
c = input()

count = 0

for i in range(n):
    if a[i] == b[i] and b[i] == c[i] and c[i] == a[i]:
        break
    elif a[i] != b[i] and b[i] != c[i] and c[i] != a[i]:
        count += 2
    else:
        count += 1

print(count)


Failing test case input:
9
tneredgib
cifreefnt
difrefent

Expected output:
10


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
a = input()
b = input()
c = input()

count = 0

for i in range(n):
    if a[i] == b[i] and b[i] == c[i] and c[i] == a[i]:
        pass
    elif a[i] != b[i] and b[i] != c[i] and c[i] != a[i]:
        count += 2
    else:
        count += 1

print(count)

Problem: p03140
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
x = [input() for i in range(3)]
c=0
for i in range(n):
    c+=len(set([x[0][i],x[1][i],x[0][i]]))-1
print(c)

Failing test case input:
7
neyjokt
tjtosus
agrlorq

Expected output:
13


Actual output:
7


Fixed submission (verdict: Accepted):
n = int(input())
x = [input() for i in range(3)]
c=0
for i in range(n):
    c+=len(set([x[0][i],x[1][i],x[2][i]]))-1
print(c)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
A=list(input())
B=list(input())
C=list(input())
litter=[]
c=0
for s in range(N):
    print(len(set([A[s],B[s],C[s]])))
    c+=[0,0,1,2][len(set([A[s],B[s],C[s]]))]
print(c)

Failing test case input:
4
tewv
`ftt
saiw

Expected output:
8


Actual output:
3
3
3
3
8


Fixed submission (verdict: Accepted):
N=int(input())
A=list(input())
B=list(input())
C=list(input())
litter=[]
c=0
for s in range(N):
    c+=[0,0,1,2][len(set([A[s],B[s],C[s]]))]
print(c)
Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
ans = 0
a = input()
b = input()
c = input()
for i in range(n):
  if a[i] == b[i] == c[i]:
    pass
  elif a[i] == b[i] or a[i] == c[i] or a[i] == c[i]:
    ans += 1
  else:
    ans += 2
print(ans)


Failing test case input:
9
bigredent
bifreefnt
tddfmtfhe

Expected output:
11


Actual output:
12


Fixed submission (verdict: Accepted):
n = int(input())
ans = 0
a = input()
b = input()
c = input()
for i in range(n):
  if a[i] == b[i] == c[i]:
    pass
  elif a[i] == b[i] or a[i] == c[i] or b[i] == c[i]:
    ans += 1
  else:
    ans += 2
print(ans)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
  if len(set([a,b,c]))==3:
    ans+=2
  elif len(set([a,b,c]))==2:
    ans+=1
print(ans)
    

Failing test case input:
4
wetu
`est
w`it

Expected output:
5


Actual output:
8


Fixed submission (verdict: Accepted):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
  ans+=len(set([a[i],b[i],c[i]]))-1
print(ans)

Problem: p03140
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
a=input()
b=input()
c=input()
d=0
for i in range(n):
  if a[i]==b[i]==c[i]:
    continue
  elif a[i]==b[i] or b[i]==c[i]:
    d+=1
  else:
    d+=2
print(d)

Failing test case input:
7
neyjokt
tjsosus
aqrmorg

Expected output:
13


Actual output:
14


Fixed submission (verdict: Accepted):
n=int(input())
a=input()
b=input()
c=input()
d=0
for i in range(n):
  if a[i]==b[i]==c[i]:
    continue
  elif a[i]==b[i] or b[i]==c[i] or a[i]==c[i]:
    d+=1
  else:
    d+=2
print(d)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = input()
b = input()
c = input()
count = 0
for i in range(n):
    if a[i] == b[i] and b[i] == c[i]:
        continue
    elif a[i] == b[i] or b[i] == c[i]:
        count += 1
    else:
        count += 2
print(count)


Failing test case input:
7
neyjokt
tjsosus
agrmorq

Expected output:
13


Actual output:
14


Fixed submission (verdict: Accepted):
n = int(input())
a = input()
b = input()
c = input()
count = 0
for i in range(n):
    if a[i] == b[i] and b[i] == c[i]:
        continue
    elif a[i] == b[i] or b[i] == c[i] or a[i] == c[i]:
        count += 1
    else:
        count += 2
print(count)
Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

a = input()
b = input()
c = input()

ans = 0

for count in range(n-1):
    tmp = 0
    if a[count] == b[count]:
        if a[count] != c[count]:
            tmp += 1
    else:
        tmp += 1
        if (a[count] != c[count]) & (b[count] != c[count]):
            tmp += 1
    ans += tmp
    
print(ans)


Failing test case input:
4
vewt
`sgt
vjsb

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())

a = input()
b = input()
c = input()

ans = 0

for count in range(n):
    tmp = 0
    if a[count] == b[count]:
        if a[count] != c[count]:
            tmp += 1
    else:
        tmp += 1
        if (a[count] != c[count]) & (b[count] != c[count]):
            tmp += 1
    ans += tmp
    
print(ans)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input());aa=[input()for i in range(3)];ans=0
for i in range(n):
  a,b,c=aa[0][i],aa[1][i],aa[2][i]
  if not a==b==c:
    if a!=b!=c:ans+=2
    else:ans+=1
print(ans)

Failing test case input:
7
ukoknez
ustnuit
pro`rgm

Expected output:
12


Actual output:
13


Fixed submission (verdict: Accepted):
n=int(input());aa=[input()for i in range(3)];ans=0
for i in range(n):
  a,b,c=aa[0][i],aa[1][i],aa[2][i]
  if not a==b==c:
    if a!=b!=c!=a:ans+=2
    else:ans+=1
print(ans)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


n = int(input())
a = input()
b = input()
c = input()
ans = 0

for i in range(n):
  if a[i]==b[i] and b[i]==c[i] and c[i]==a[i]:
    continue
  else:    
    ans += 1

print(ans)

Failing test case input:
4
wetu
east
w`it

Expected output:
6


Actual output:
4


Fixed submission (verdict: Accepted):


n = int(input())
a = input()
b = input()
c = input()
ans = 0

for i in range(n):
  if a[i]==b[i] and b[i]==c[i] and c[i]==a[i]:
    continue
  elif a[i]==b[i] or b[i]==c[i] or c[i]==a[i]:
    ans += 1 
  else:
    ans += 2

print(ans)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
int(input())
a = str(input())
b = str(input())
c = str(input())
def f(a,b,c):
    ans = 0
    for i in range(len(a)):
        if a[i] != b[i]:
            ans += 1
        if a[i] != c[i]:
            ans += 1
    return ans
ans = min(f(a,b,c),f(b,c,a),f(c,a,b))
print(ans)
 

Failing test case input:
4
wetv
`est
wait

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
int(input())
a = str(input())
b = str(input())
c = str(input())
def f(a,b,c):
    ans = 0
    for i in range(len(a)):
        if a[i] != b[i]:
            ans += 1
        if a[i] != c[i] and c[i] != b[i]:
                ans += 1 
    return ans
ans = min(f(a,b,c),f(b,c,a),f(c,a,b))
print(ans)
Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for j in range(n):
    d=a[j]
    e=b[j]
    f=c[j]
    if d==e and d!=f:
      ans+=1
    elif d==f and d!=e:
      ans+=1
    elif e==f and e!=d:
      ans+=1
    elif d!=e and e!=f and f!=d:
      ans+=2

Failing test case input:
4
wetu
east
w`it

Expected output:
6


Actual output:

Fixed submission (verdict: Accepted):
n=int(input())
a=input()
b=input()
c=input()
ans=0
for j in range(n):
    d=a[j]
    e=b[j]
    f=c[j]
    if d==e and d!=f:
      ans+=1
    elif d==f and d!=e:
      ans+=1
    elif e==f and e!=d:
      ans+=1
    elif d!=e and e!=f and f!=d:
      ans+=2
    
print(ans)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = input()
B = input()
C = input()
count = 0
for i in range(N):
    if A[i] == B[i] == C[i]:
        count += 0
    elif A[i] == B[i] or B[i] == C[i] or A[i] == C[i]:
        count += 1
    else:
        count += 3
print(count)

Failing test case input:
7
neyjokt
tjtosus
agrmorq

Expected output:
13


Actual output:
19


Fixed submission (verdict: Accepted):
N = int(input())
A = input()
B = input()
C = input()
count = 0
for i in range(N):
    if A[i] == B[i] == C[i]:
        count += 0
    elif A[i] == B[i] or B[i] == C[i] or A[i] == C[i]:
        count += 1
    else:
        count += 2
print(count)

Problem: p03140
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a = int(input())
b = (input())
c = (input())
d = (input())
count = 0
for i in range(a):
    if b[i] == c[i] == d[i]:
        count += 0
    elif b[i] == c[i] or b[i] == d[i] == c[i] == d[i]:
        count += 1
    else:
        count += 2
print(count)


Failing test case input:
9
tneredgib
cifreefnt
different

Expected output:
11


Actual output:
15


Fixed submission (verdict: Accepted):
a = int(input())
b = (input())
c = (input())
d = (input())
count = 0
for i in range(a):
    if b[i] == c[i] == d[i]:
        count += 0
    elif b[i] == c[i] or b[i] == d[i]  or  c[i] == d[i]:
        count += 1
    else:
        count += 2
print(count)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(str(input()))
B = list(str(input()))
C = list(str(input()))

res = 0
for i in range(N):
    if A[i] != B[i]:
        res+=1
    if A[i] != C[i]:
        res+=1

print(res)


Failing test case input:
9
tneredfic
ciffeernt
different

Expected output:
11


Actual output:
16


Fixed submission (verdict: Accepted):
N = int(input())
A = list(str(input()))
B = list(str(input()))
C = list(str(input()))

res = 0
for i in range(N):
    if A[i] != B[i] or  A[i] != C[i] or  B[i] != C[i]:
        res+=1
    if A[i] != B[i] and A[i] != C[i] and B[i] != C[i]:
        res+=1
print(res)
Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def data_input():
    a = input()
    b = input()
    c = input()
    d = input()
    return (int(a),b,c,d)
def answer():
    n,a,b,c = data_input()
    counta = 0
    countb = 0
    countc = 0
    for i in range(n):
        if a[i] != b[i]:
            counta += 1
    for i in range(n):
        if a[i] != c[i]:
            countb += 1
    for i in range(n):
        if a[i] != c[i]:
            countc += 1
    return counta + countb + countc - max(counta,countb,countc)

def output():
    res = answer()
    print(res)
output()

Failing test case input:
7
neyjokt
tjsosus
aqrmorg

Expected output:
13


Actual output:
12


Fixed submission (verdict: Accepted):
def data_input():
    a = input()
    b = input()
    c = input()
    d = input()
    return (int(a),b,c,d)
def answer():
    n,a,b,c = data_input()
    counta = 0
    for i in range(n):
        count = 0
        if a[i] != b[i]:
            count += 1
        if a[i] != c[i]:
            count += 1
        if b[i] != c[i]:
            count += 1
        if count != 0:
            count -= 1
        counta += count

    return counta

def output():
    res = answer()
    print(res)
output()

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = input()
B = input()
C = input()

ans = 0
for i in range(N):
      if A[i] != B[i] != C[i]:
        ans += 2

      elif A[i] != B[i]:
        ans += 1

      elif A[i] != C[i]:
        ans += 1

      elif B[i] != C[i]:
        ans += 1

print(ans)

Failing test case input:
7
neyjokt
tjsosus
aqrmorg

Expected output:
13


Actual output:
14


Fixed submission (verdict: Accepted):
N = int(input())
A = input()
B = input()
C = input()

ans = 0
for i in range(N):
  if A[i] == B[i] == C[i]:
    ans += 0

  elif A[i] == B[i]:
    ans += 1

  elif A[i] == C[i]:
    ans += 1

  elif B[i] == C[i]:
    ans += 1

  elif A[i] != B[i] and B[i] != C[i]:
    ans += 2

print(ans)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = input()
B = input()
C = input()
cnt = 0
for i in range(N):
  if A[i] == B[i] == C[i]:
    cnt += 0
  elif A[i] != B[i] != C[i]:
    cnt += 2
  else:
    cnt += 1
print(cnt)

Failing test case input:
4
vext
`sgt
vjbs

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):
N = int(input())
A = input()
B = input()
C = input()
cnt = 0
for i in range(N):
  if A[i] == B[i] == C[i]:
    cnt += 0
  elif A[i] != B[i] and B[i] != C[i] and C[i] != A[i]:
    cnt += 2
  else:
    cnt += 1
print(cnt)
Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=input()
b=input()
c=input()
al=list(a)
bl=list(b)
cl=list(c)

count=0

for i in range(n):
    if al[i]==bl[i]:
        if al[i]==cl[i]:
            plus=2
        else:
            plus=1
    elif bl[i]==cl[i]:
        plus=1
    elif al[i]==cl[i]:
        plus=1
    else:
        plus=0
        
    count+=plus
    
print(count)

Failing test case input:
7
ukoknez
tnuitsu
program

Expected output:
13


Actual output:
1


Fixed submission (verdict: Accepted):
n=int(input())
a=input()
b=input()
c=input()
al=list(a)
bl=list(b)
cl=list(c)

count=0

for i in range(n):
    if al[i]==bl[i]:
        if al[i]==cl[i]:
            plus=0
        else:
            plus=1
    elif bl[i]==cl[i]:
        plus=1
    elif al[i]==cl[i]:
        plus=1
    else:
        plus=2
        
    count+=plus
    
print(count)

Problem: p03140
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
arr=[input() for _ in range(3)]
ans=0
for i in range(n):
  if arr[0][i]==arr[1][i] and arr[1][i]==arr[2][i]:
    tmp=0
  elif arr[0][i]==arr[1][i] or arr[1][i]==arr[2][i] or arr[2][i]==arr[0][i]:
    tmp=1
  else:
    tmp=0
  ans+=tmp
print(ans)

Failing test case input:
9
tnedergia
cifreefnt
difsmfeet

Expected output:
14


Actual output:
4


Fixed submission (verdict: Accepted):
n=int(input())
arr=[input() for _ in range(3)]
ans=0
for i in range(n):
  if arr[0][i]==arr[1][i] and arr[1][i]==arr[2][i]:
    tmp=0
  elif arr[0][i]==arr[1][i] or arr[1][i]==arr[2][i] or arr[2][i]==arr[0][i]:
    tmp=1
  else:
    tmp=2
  ans+=tmp
print(ans)
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

if s[0] == s[1] and s[2] == s[3] and s[1] != s[2]:
    print('YES')
elif s[0] == s[2] and s[1] == s[3] and s[1] != s[1]:
    print('YES')
elif s[0] == s[3] and s[1] == s[2] and s[0] != s[1]:
    print('YES')
else:
    print('NO')

Failing test case input:
EEQG

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s = input()

if s[0] == s[1] and s[2] == s[3] and s[1] != s[2]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[0] != s[1]:
    print('Yes')
elif s[0] == s[3] and s[1] == s[2] and s[0] != s[1]:
    print('Yes')
else:
    print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
list(S).sort()


if S[0]==S[1] and S[2] == S[3] and S[0] != S[2]:
   print("Yes")
else:
   print("No")

Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
S = input()
A=list(S)
A.sort()



if A[0]==A[1] and A[2] == A[3] and A[0] != A[2]:
   print("Yes")
else:
   print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
a=s[0]
b=0
ac=1
bc=1
for i in range(1,4):
    if s[i]!=a:
        if s[i]!=b:
            if b==0:
                b=s[i]
            else:
                break
        else:
            bc-=1
    else:
        ac-=1
print(ac,bc)
if ac==0 and bc==0:
    print("Yes")
else:
    print("No")



Failing test case input:
SR@C

Expected output:
No


Actual output:
1 1
No


Fixed submission (verdict: Accepted):
s=input()
a=s[0]
b=0
ac=1
bc=1
for i in range(1,4):
    if s[i]!=a:
        if s[i]!=b:
            if b==0:
                b=s[i]
            else:
                break
        else:
            bc-=1
    else:
        ac-=1
if ac==0 and bc==0:
    print("Yes")
else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
for i in s:
  if s.count(i)!=2:
    print("NO")
    break
else:
  print("YES")

Failing test case input:
EDQG

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s = input()
for i in s:
  if s.count(i)!=2:
    print("No")
    break
else:
  print("Yes")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys


S = [str(s) for s in input()]

s_dic = {}
for s in S:
    if s in s_dic.keys():
        s_dic[s] += 1
    else:
        s_dic[s] = 1


for i in s_dic.values():
    if int(i) != 2:
        print("NO")
        sys.exit()

print("YES")


Failing test case input:
RPPS

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
import sys


S = [str(s) for s in input()]

s_dic = {}
for s in S:
    if s in s_dic.keys():
        s_dic[s] += 1
    else:
        s_dic[s] = 1


for i in s_dic.values():
    if int(i) != 2:
        print("No")
        sys.exit()

print("Yes")
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
from collections import Counter
c = Counter(S)

if 2 in c.values() or len(c.keys()) == 2:
    print('Yes')
else:
    print('No') 

Failing test case input:
RR@C

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
from collections import Counter
c = Counter(S)

if 2 in c.values() and len(c.keys()) == 2:
    print('Yes')
else:
    print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
set_s=set(list(s))
list_s=list(s)
list_s.sort()
if len(set_s)==2 and list_s[0]==list_s[1] and list_s[2]==list_s[3]:
  print('YES')
else:
  print('NO')


Failing test case input:
HCEP

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s=input()
set_s=set(list(s))
list_s=list(s)
list_s.sort()
if len(set_s)==2 and list_s[0]==list_s[1] and list_s[2]==list_s[3]:
    print('Yes')
else:
    print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

def mozi(S):
    s = list(S)
    s2 = list(set(s))
    if len(s2) != 2:
        ans = 'No'
        return ans
    else:
        p = 0
        q = 0
        for item in s:
            if item == s2[0]:
                p+=1
            if item == s2[1]:
                q+=1
        if p == 2 and q == 2:
            ans = 'Yes'
            return ans
        else:
            ans = 'No'
            return ans

args = sys.argv
S = args[0]
print(mozi(S))


Failing test case input:
FFEE

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
def mozi(S):
    s = list(S)
    s2 = list(set(s))
    if len(s2) != 2:
        ans = 'No'
        return ans
    else:
        p = 0
        q = 0
        for item in s:
            if item == s2[0]:
                p+=1
            if item == s2[1]:
                q+=1
        if p == 2 and q == 2:
            ans = 'Yes'
            return ans
        else:
            ans = 'No'
            return ans



S = input()
print(mozi(S))

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = sorted(list(input()))
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('YES')
else:
    print('NO')

Failing test case input:
TRLP

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
S = sorted(list(input()))
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('Yes')
else:
    print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections

S = str(input())
c = collections.Counter(S)

if all([x==2 for x in c.values()]):
    print("YES")
else:
    print("NO")

Failing test case input:
SOMT

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
import collections

S = str(input())
c = collections.Counter(S)

if all([x==2 for x in c.values()]):
    print("Yes")
else:
    print("No")
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



def main(s):
    for _s in s[:1]:
        if s.count(_s) != 2:
            print('No')
            return
    print('Yes')


if __name__ == "__main__":
    main(input())


Failing test case input:
RR@C

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):



def main(s):
    for _s in s:
        if s.count(_s) != 2:
            print('No')
            return

    print('Yes')


if __name__ == "__main__":
    main(input())

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())

line = set(s)

if len(s) == 2:
    print("Yes")
else:
    print("No")

Failing test case input:
FFEE

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = list(input())

line = list(set(s))

if len(line) == 2:
    print("Yes")
else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input());
ans = 0;

if s[0] == s[1] or s[0] == s[2] or s[0] == s[3]: ans += 1
if s[1] == s[2] or s[1] == s[3]: ans += 1
if s[2] == s[3]: ans += 1
print(ans);

Failing test case input:
HGPC

Expected output:
No


Actual output:
0


Fixed submission (verdict: Accepted):
s = list(input());
ans = 0;

if s[0] == s[1] or s[0] == s[2] or s[0] == s[3]: ans += 1;
if s[1] == s[2] or s[1] == s[3]: ans += 1;
if s[2] == s[3]: ans += 1;
if ans == 2: print("Yes");
else: print("No");

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
string = sys.stdin.readline()

if all([string.count(c)==2 for c in set(string)]) :
    print('Yes')
else:
    print('No')

Failing test case input:
SOOS

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
string = input()

if all([string.count(c)==2 for c in set(string)]) :
    print('Yes')
else:
    print('No')

Problem: p02987
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


s = input()
cnt = {l:0 for l in set(s)}
if len(cnt) != 2:
    print('No')

for l in s:
    cnt[l] += 1
    if cnt[l] > 2:
        print('No')

print('Yes')


Failing test case input:
RC@R

Expected output:
No


Actual output:
No
Yes


Fixed submission (verdict: Accepted):


s = input()
cnt = {l:0 for l in set(s)}
if len(cnt) != 2:
    print('No')
    exit(0)

for l in s:
    cnt[l] += 1
    if cnt[l] > 2:
        print('No')
        exit(0)

print('Yes')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l = list(input().split())

dic = {}
for i, v in enumerate(l):
    if v in dic:
        dic[v] += 1
    else:
        dic[v] = 1

li = list(dic.values())

if len(li) == 2 and li[0] == 2 and li[1] == 2:
    print('Yes')
else:
    print('No')


Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
l = list(input())

dic = {}
for i, v in enumerate(l):
    if v in dic:
        dic[v] += 1
    else:
        dic[v] = 1

li = list(dic.values())
if li[0] == 2 and li[1] == 2:
    print('Yes')
else:
    print('No')
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = list(s)[0]
s = s.replace(t, '', 2)
if(list(s)[0] != t):
    s = s.replace(t, '', 2)
if(len(s) == 0):
    print("Yes")
else:
    print("No")


Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = list(s)[0]
s = s.replace(t, '', 2)
if(list(s)[0] != t):
    s = s.replace(list(s)[0], '', 2)
if(len(s) == 0):
    print("Yes")
else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(input())
a.sort()
b = False
c = False
if a[0] == a[1]:
    b = True

if a[2] == a[3]:
    c = True
print(b and c)    

Failing test case input:
PDGJ

Expected output:
No


Actual output:
False


Fixed submission (verdict: Accepted):
a = list(input())
a.sort()
b = "No"
if a[0] == a[1]:
    if a[2] == a[3]:
        if a[2] != a[0]:
            b = "Yes"
print(b)

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=list(input())
print("Yes" if len(sorted(S))==2 else "No")

Failing test case input:
SOOS

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
S=list(input())
print("Yes" if len(set(S))==2 else "No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys 

word =input()
flag = 0

for i in range(4):
    if word.count(word[i]) == 2:
        flag += 1
    
if flag == 4:
    print("yes")
else:
    print("No")

Failing test case input:
FFEE

Expected output:
Yes

Actual output:
yes


Fixed submission (verdict: Accepted):
import sys 

word =input()
flag = 0

for i in range(4):
    if word.count(word[i]) == 2:
        flag += 1
    
if flag == 4:
    print("Yes")
else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections as c
s=input()
a=c.Counter(s)
if a.values()==[2,2]:
  print('Yes')
else:
  print('No')

Failing test case input:
EEFF

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import collections as c
s=input()
a=c.Counter(s)
if str(a.values())=='dict_values([2, 2])':
  print('Yes')
else:
  print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
chars = sorted(list(S))
if chars[0] == chars[1] and chars[2] == chars[3]:
    print("YES")
else:
    print("NO")

Failing test case input:
SPOT

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
S = input()
chars = sorted(list(S))
if chars[0] == chars[1] and chars[1] != chars[2] and chars[2] == chars[3]:
    print("Yes")
else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
y = sorted(list(input()))

if (y[0] == y[1]) and(y[2]== y[3])and(y[0]!=y[2]):
    print('YES')
else:
    print('NO')

Failing test case input:
ROPS

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
y = sorted(list(input()))

if (y[0] == y[1]) and(y[2]== y[3])and(y[0]!=y[2]):
    print('Yes')
else:
    print('No')
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import sys
tmp = input()

print(tmp)
if (tmp[0] == tmp[1]) and (tmp[2] == tmp[3]) and (tmp[1] != tmp[3]):
	print("Yes")
	sys.exit()
if (tmp[0] == tmp[2]) and (tmp[1] == tmp[3]) and (tmp[2] != tmp[3]):
	print("Yes")
	sys.exit()
if (tmp[0] == tmp[3]) and (tmp[2] == tmp[1]) and (tmp[1] != tmp[3]):
	print("Yes")
	sys.exit()
print("No")



Failing test case input:
HECO

Expected output:
No


Actual output:
HECO
No


Fixed submission (verdict: Accepted):


import sys
tmp = input()

if (tmp[0] == tmp[1]) and (tmp[2] == tmp[3]) and (tmp[1] != tmp[3]):
	print("Yes")
	sys.exit()
if (tmp[0] == tmp[2]) and (tmp[1] == tmp[3]) and (tmp[2] != tmp[3]):
	print("Yes")
	sys.exit()
if (tmp[0] == tmp[3]) and (tmp[2] == tmp[1]) and (tmp[1] != tmp[3]):
	print("Yes")
	sys.exit()
print("No")

Problem: p02987
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def li():
    return list(map(int, input().split()))


if __name__ == "__main__":
    s = input()
    a = s[0]
    b = ""
    found_a = False
    found_b = False
    for si in s[1:]:
        if si != a:
            if si != b:
                b = si
            found_b = True
        else:
            found_a = True

    if found_a and found_b:
        print("Yes")
    else:
        print("No")


Failing test case input:
SMOS

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def li():
    return list(map(int, input().split()))


if __name__ == "__main__":
    s = input()
    a = s[0]
    b = ""
    found_a = False
    found_b = False
    for si in s[1:]:
        if si != a:
            if si != b:
                b = si
            else:
                found_b = True
        else:
            found_a = True

    if found_a and found_b:
        print("Yes")
    else:
        print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
S.sort()
print("Yes") if S.count(S[0]) == S.count(S[2]) else print("No")


Failing test case input:
AQSB

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = list(input())
S.sort()
print("Yes") if S[0] == S[1] and S[2] == S[3] and S[0] != S[2] else print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input_data=input()

a=input_data[0]
b=input_data[1]
c=input_data[2]
d=input_data[3]

if a==b :
    if c==d and a!=c :
            output="yes"
    else :
        output="no"
    
else :
        if a==c and b==d :
            output="yes"
    
        elif a==d and b==c :
            output="yes"
        
        else :
            output="no"
           
print(output)

Failing test case input:
GDDP

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
input_data=input()
 
a=input_data[0]
b=input_data[1]
c=input_data[2]
d=input_data[3]
 
if a==b :
    if c==d and a!=c :
            output="Yes"
    else :
        output="No"
    
else :
        if a==c and b==d :
            output="Yes"
    
        elif a==d and b==c :
            output="Yes"
        
        else :
            output="No"
           
print(output)
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
if S[0]==S[1]:
    if S[2]==S[3] and S[0]!=S[2]:
        print("Yes")
    else:
        print("No")
elif S[0]==S[2]:
    if S[1]==S[3]:
        print("Yes")
    else:
        print("No")
elif S[0]==S[3]:
    if S[1]==S[2]:
        print("Yes")
    else:
        print("No")

Failing test case input:
TOMR

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
import sys
S=input()
if S[0]==S[1]:
    if S[2]==S[3] and S[0]!=S[2]:
        print("Yes")
        sys.exit()
elif S[0]==S[2]:
    if S[1]==S[3]:
        print("Yes")
        sys.exit()
elif S[0]==S[3]:
    if S[1]==S[2]:
        print("Yes")
        sys.exit()
print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = sorted(list(input()))
if s[0] == s[1]:
    if s[2] == s[3] and s[1] != s[2]:
        print("yes")
    else:
        print("no")

else:
    print("no")

Failing test case input:
IGCP

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
s = sorted(input())

if len(s) == 4:
    if s[0] == s[1] and s[2] == s[3] and s[0] != s[3]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Problem: p02987
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
s = sorted(list(input()))
if len(set(s)) == 2 and s[1] == s[2]:
    print('Yes')
else:
    print('No')

Failing test case input:
FFEE

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = sorted(list(input()))
if len(set(s)) == 2 and s[1] != s[2]:
    print('Yes')
else:
    print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
count=0
first=False
OK=False
memo=S[0]
for i in range(4):    
    if S[i]==S[0]:
        count+=1
    elif (S[i]!=S[0] and first==False):
        memo=S[i]
        first=True
        print(memo)

    elif (S[i]!=S[0] and first==True):
        if S[i]==memo:
            OK=True

print(count)
print(memo)

if (count==2 and OK==True):
    print("Yes")
else:
    print("No")

Failing test case input:
S@RB

Expected output:
No


Actual output:
@
1
@
No


Fixed submission (verdict: Accepted):
S=input()
count=0
first=False
OK=False
memo=S[0]
for i in range(4):    
    if S[i]==S[0]:
        count+=1
    elif (S[i]!=S[0] and first==False):
        memo=S[i]
        first=True
    elif (S[i]!=S[0] and first==True):
        if S[i]==memo:
            OK=True


if (count==2 and OK==True):
    print("Yes")
else:
    print("No")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
S = input()
c = collections.Counter(S)
x = c.most_common()
print(x)
if x[0][1] == 2:
    if x[1][1] == 2:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Failing test case input:
GCEP

Expected output:
No


Actual output:
[('G', 1), ('C', 1), ('E', 1), ('P', 1)]
No


Fixed submission (verdict: Accepted):
import collections
S = input()
c = collections.Counter(S)
x = c.most_common()
if x[0][1] == 2:
    if x[1][1] == 2:
        print('Yes')
    else:
        print('No')
else:
    print('No')
Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = input()
 
def Combination(x):
  if x[0] == x[1]:
    if x[2] == x[3]:
      return "Yes"
  elif x[0] == x[2]:
    if x[1] == x[3]:
      return "Yes"
  elif x[0] == x[3]:
    if x[1] == x[2]:
      return "Yes"
  else:
    return "No"
print(Combination(x))

Failing test case input:
SNOS

Expected output:
No


Actual output:
None


Fixed submission (verdict: Accepted):
x = input()
 
def Combination(x):
  if x[0] == x[1] and x[2] == x[3] and x[0] != x[2]:
      return "Yes"
  elif x[0] == x[2] and x[1] == x[3] and x[0] != x[1]:
      return "Yes"
  elif x[0] == x[3] and x[1] == x[2] and x[0] != x[2]:
      return "Yes"
  else:
    return "No"
print(Combination(x))

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
S_set = set(S)

for target in S_set:
    if S.count(target) == 2:
        print("Yes")
        exit()

print("No")


Failing test case input:
S@SC

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = list(input())
S_set = set(S)

for target in S_set:
    if S.count(target) != 2:
        print("No")
        exit()

print("Yes")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
for i in s:
  if s.count(i) != 2:
    print("No")
print("Yes")

Failing test case input:
CHEO

Expected output:
No


Actual output:
No
No
No
No
Yes


Fixed submission (verdict: Accepted):
s = input()
for i in s:
  if s.count(i) != 2:
    print("No")
    exit()
print("Yes")

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
cnt = 0

for i in range(len(s)):
    for j in range(1,len(s)):
        if s[i] == s[j]:
            ++cnt
if cnt % 2 == 0:
    print('Yes')
else:
    print('No')

Failing test case input:
RC?Q

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
cnt = 0

for i in range(len(s)):     
    for j in range(len(s)):
        if i ==j:
            continue
        elif s[i] == s[j]:
            cnt+=1
            
if cnt == 4:
    print('Yes')
else:
    print('No')

Problem: p02987
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
word = input()
dict_word = {}
for i in range(len(word)):
  try:
    count = dict_word[word[i]]
    dict_word[word[i]] += 1
  except:
    dict_word[word[i]] = 1


if len(dict_word) == 2 and list(dict_word.values()) == [2, 2]:
  print('YES')
else:
  print('NO')

Failing test case input:
D?RQ

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
word = input()
dict_word = {}
for i in range(len(word)):
  try:
    count = dict_word[word[i]]
    dict_word[word[i]] += 1
  except:
    dict_word[word[i]] = 1


if len(dict_word) == 2 and list(dict_word.values()) == [2, 2]:
  print('Yes')
else:
  print('No')