TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import collections
s = str(input())
l = []
for i in range(0,4):
  l.append(s[i])
  i += 1
c = collections.Counter(l)
print(len(c))

import collections
s = str(input())
l = []
for i in range(0,4):
  l.append(s[i])
  i += 1
c = collections.Counter(l)

if len(c) == 2:
  print('Yes')
else:
  print('No')


Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
t = set(s)
if len(t) != 2:
  print('No')
else:
  for char in t:
    ans = arr([(s.count(char) == 2) for char in t])
  if ans:
    print('Yes')
  else:
    print('No')

s = input()
s = sorted(s)
if s[0] == s[1] and s[2] == s[3] and not (s[1] == s[2]):
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import math
all ,blue = map(int,input().split())
red = all - blue

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


for i in range(1,blue+1):
    if (red+1) < i:
        print('0')
    else:
        print((combinations_count(blue-1,i-1)*combinations_count(red+1,i))%(10**9+7))





S = list(input())
S.sort()
if S[0] == S[1] and S[1] != S[2] and S[2] == S[3]:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
s = s.replace(s[0],'')
if len(s) == 0:
    print('No')
    break
else:
    s = s.replace(s[0],'')
if len(s) == 0:
    print('Yes')
else:
    print('No')

import sys
s = input()
s = s.replace(s[0],'')
if len(s) == 0:
    print('No')
    sys.exit()
else:
    s = s.replace(s[0],'')
if len(s) == 0:
    print('Yes')
else:
    print('No')


Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=input()

a=s[0]
b=''
for i in range(1,4):
  if s[i]!=b:
    b=s[i]
ca=0
cb=0
for i in range(4):
  if s[i]!=a and s[i]!=b:
    print('No')
    exit()
  if s[i]==a:
    ca+=1
  elif s[i]==b:
    cb+=1
if ca==2 and cb==2:
  print('Yes')
else:
  print('No')

s=input()

a=s[0]
b=''
for i in range(1,4):
  if s[i]!=a:
    b=s[i]
    break
ca=0
cb=0
for i in range(4):
  if s[i]!=a and s[i]!=b:
    print('No')
    exit()
  if s[i]==a:
    ca+=1
  elif s[i]==b:
    cb+=1
if ca==2 and cb==2:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
SS = list(S)
print(S)
boo = False
boo2 = False
s1 = S[0]
s2 = S[1]
s3 = S[2]
s4 = S[3]
if s1 == s2:
    SS.pop(1)
    SS.pop(0)
elif s1 == s3:
    SS.pop(2)
    SS.pop(0)
elif  s1 == s4:
    SS.pop(3)
    SS.pop(0)
elif s2 == s3:
    SS.pop(2)
    SS.pop(1)
elif s2 == s4:
    SS.pop(3)
    SS.pop(1)
elif s3 == s4:
    SS.pop(3)
    SS.pop(2)
    
if len(SS) == 4:
    print("No")
elif SS[0] == SS[1]:
    print("Yes")
else:
    print("No")


S = input()
SS = list(S)
boo = False
boo2 = False
s1 = S[0]
s2 = S[1]
s3 = S[2]
s4 = S[3]
buf = ""
if s1 == s2:
    buf =SS.pop(1)
    buf =SS.pop(0)
elif s1 == s3:
    buf=SS.pop(2)
    buf=SS.pop(0)
elif  s1 == s4:
    buf=SS.pop(3)
    buf=SS.pop(0)
elif s2 == s3:
    buf=SS.pop(2)
    buf=SS.pop(1)
elif s2 == s4:
    buf=SS.pop(3)
    buf=SS.pop(1)
elif s3 == s4:
    buf=SS.pop(3)
    buf=SS.pop(2)
    
if len(SS) == 4:
    print("No")
elif SS[0] == SS[1] and buf != SS[0]:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
a = input()
print(a)
msg1 = "@"
msg2 = "#"
countmsg1 = 0
countmsg2 = 0
flag = 0
for strliteral in a:
    if strliteral == msg1:
        countmsg1 += 1
    elif strliteral == msg2:
        countmsg2 += 1
    else:
        if msg1 == "@":
            msg1 = strliteral
            countmsg1 += 1
        else:
            if msg2 == "#":
                msg2 = strliteral
                countmsg2 += 1
if countmsg2 == 2 and countmsg2 == 2:
    print("Yes")
else:
    print("No")

a = input()
print(a)
msg1 = "@"
msg2 = "#"
countmsg1 = 0
countmsg2 = 0
flag = 0
for strliteral in a:
    if strliteral == msg1:
        countmsg1 += 1
    elif strliteral == msg2:
        countmsg2 += 1
    else:
        if msg1 == "@":
            msg1 = strliteral
            countmsg1 += 1
        else:
            if msg2 == "#":
                msg2 = strliteral
                countmsg2 += 1
if countmsg2 == 2 and countmsg2 == 2:
    print("Yes")
else:
    print("No")

a = input()
msg1 = "@"
msg2 = "#"
countmsg1 = 0
countmsg2 = 0
flag = 0
for strliteral in a:
    if strliteral == msg1:
        countmsg1 += 1
    elif strliteral == msg2:
        countmsg2 += 1
    else:
        if msg1 == "@":
            msg1 = strliteral
            countmsg1 += 1
        else:
            if msg2 == "#":
                msg2 = strliteral
                countmsg2 += 1
if countmsg2 == 2 and countmsg2 == 2:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=input()
if len(list(s))==2 and s.count(s[0])==2:print("Yes")
else:print("No")

s=input()
if len(set(list(s)))==2:print('Yes')
else:print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
a = ''.join(sorted(s))
if a[1] == a[2] and a[3] == a[4] and a[1] != a[3]:
  print('Yes')
else:
  print('No')

s = input()
a = ''.join(sorted(s))
if a[0] == a[1] and a[2] == a[3] and a[0] != a[3]:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
s_sorted = ''.join(sorted(s))
if s_sorted[0]==s_sorted[1] and s_sorted[2]==s_sorted[3] and S[1]!=S[2]:
  print('Yes')
else:
  print('No')

s = input()
s_sorted = ''.join(sorted(s))
if (s_sorted[0]==s_sorted[1]) and (s_sorted[2]==s_sorted[3]) and (s_sorted[1]!=s_sorted[2]):
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S=input()
list=[S[0],S[1],S[2],S[3]]
if list.count(S[0])==list.count(S[1])==list.count(S[2])==list.count(S[3])=='2':
  print('Yes')
else:
  print('No')

S=input()
if S[0]==S[1] and S[2]==S[3] and not S[1]==S[2]:
  print('Yes')
else:
  print('No')

S=input()
if S[0]==S[1] and S[2]==S[3] and not S[1]==S[2]:
  print('Yes')
else:
  print('No')

S=input()
list=[S[0],S[1],S[2],S[3]]
if list.count(S[0])==list.count(S[1])==list.count(S[2])==list.count(S[3])==2:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
cnt = 0
for moji in s:
    
    num = s.count(moji)
    #print(num)
    if num == 2:
        cnt+=1
    else:
        break
        
if cnt == 4:
    print("Yes")
else:
    print("No")

s = str(input())
cnt = 0
for moji in s:
    
    num = s.count(moji)
    #print(num)
    if num == 2:
        cnt+=1
    else:
        break
        
if cnt == 4:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = list(input())

line = set(s)

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

s = list(input())

line = list(set(s))

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

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = list(input())
c = 0

if s[0]==s[1]:
    c+=1
if s[0]==s[2]:
    c+=1
if s[0]==s[3]:
    c+=1
if s[1]==s[2]:
    c+=1
if s[2]==s[3]:
    c+=1

if c == 2:
    print('yes')
else:
    print('no')

s = list(input())
c = 0

if s[0]==s[1]:
    c+=1
if s[0]==s[2]:
    c+=1
if s[0]==s[3]:
    c+=1
if s[1]==s[2]:
    c+=1
if s[1]==s[3]:
    c+=1
if s[2]==s[3]:
    c+=1

if c == 2:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=input()
result=''
count=0
for i in s:
    if result != i:
        result==i
        count+=1
        if count==2:
            print('Yes')
        else:
            print('No')

a=list(input())
b=sorted(a)
if b[0]==b[1] and b[2]==b[3] and b[1]!=b[2]:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()

li = S.split()
if ((li[0] == li[1] and li[2] ==li[3]) or (li[0] == li[2] and li[1] == li[3])
    or (li[0] ==li[3] and li[1] == li[2]):
    print('Yes')
else:
    print('No')

S = input()

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


Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
c1=0
c2=0
c3=0
a = S[0]
b = S[1]
c = S[2]
for i in S[3:]:
    if i == a:
        c1 +=1
    elif i == b:
        c2 +=1
    elif i == c:
        c3 +=1
if c3==1 or (c1 == 1 and c2 == 1):
    print("Yes")
else:
    print("No")

S = input()

s = {i for i in S}
c1=0
c2=0
if len(s) !=2:
    print("No")
else:
    a = S[0]
    b = S[1]
    for i in S[2:]:
        if i==a:
            c1 += 1
        elif i == b:
            c2 += 1
    if c1 == 2 or c2 == 2:
        print("No")
    else:
        print("Yes")


Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import collections

s = input()
c = collections.Counter(s)
if len(c) == 2 and c[s[0]] == 2:
    print('YES')
else:
    print('NO')


s = input()

a = 0
for i in range(1, len(s)):
    if s[0] == s[i]:
        a += 1

b = 0
for i in range(2, len(s)):
    if s[1] == s[i]:
        b += 1

c = 0
for i in range(3, len(s)):
    if s[2] == s[i]:
        c += 1

if a + b + c >= 2:
    print('YES')
else:
    print('NO')


import collections

s = input()
c = collections.Counter(s)
if len(c) == 2 and c[s[0]] == 2:
    print('YES')
else:
    print('NO')


import collections

s = input()
c = collections.Counter(s)
if len(c) == 2 and c[s[0]] == 2:
    print('Yes')
else:
    print('No')


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
a=input()
a.sort()
if a[0]==a[1] and a[2]==a[3]:
  print("Yes")
else:
  print("No")

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

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
x = list(set(S))
print("Yes" if len(set(S)) == 2 and len(S.remove(x[0])) == 2 and len(S.remove(x[1])) == 2 else "No")


S = input()
x = list(set(S))
print("Yes" if len(set(S)) == 2 and len(S.remove(x[0])) == 2 and len(S.remove(x[0])) == 2 else "No")

S = input()
x = list(set(S))
print("Yes" if len(set(S)) == 2 and S.count(x[0]) == 2 and S.count(x[1]) == 2 else "No")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
#ABC132 A
S = list(input())
S.sort()
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print("YES")
else:
    print("NO")

#ABC132 A
S = list(input())
S.sort()
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
w = input()
a,b,c,d = w[0],w[1],w[2],w[3]
if a == b and b != c and c == d:
    print('Yes')
elif a == b and b != c and b == d:
    print('Yes')
elif a == b and b == c and a != b:
    print('Yes')
else:
  print('No')

w = input()
a,b,c,d = w[0],w[1],w[2],w[3]
if a == b and b != c and c == d:
    print('Yes')
elif a == c and b != c and b == d:
    print('Yes')
elif a == d and b == c and a != b:
    print('Yes')
else:
  print('No')


Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=list(input())
a=len(set(s)
if a==2:
	b=len([t for t in s if t==s[0]])
	if b==2:
      	print('Yes')
    else:
      	print('No')
else:
    print('No')

s=list(input())
a=len(set(s))
ans='No'
if a==2:
  b=len([t for t in s if t==s[0]])
  if b==2:
    ans='Yes'
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S=str(input())
if S[0]==S[1] and S[2]==S[3]:
  print('Yes')
else if S[0]==S[2] and S[1]==S[3]:
  print('Yes')
else if S[0]==S[3] and S[1]==S[2]:
  print('Yes')
else:
  print('No')

S=str(input())
if S[0]==S[1] and S[1]==S[2] and S[2]==S[3]:
  print('No')
elif S[0]==S[1] and S[2]==S[3]:
  print('Yes')
elif S[0]==S[2] and S[1]==S[3]:
  print('Yes')
elif S[0]==S[3] and S[1]==S[2]:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
if len(set(input())) ==2: print("Yes)
else: print("No")                                

a = input()
if len(set(a)) == 2:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = sorted(input())
return S[0] == S[1] and S[2] == S[3] and S[1] != S[2]

from collections import Counter
S = input()
    c = Counter(S)
    for v in c.values():
        if v != 2: return False
    return True

from collections import Counter
S = input()
c = Counter(S)
for v in c.values():
  if v != 2: return False
return True

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
x = input()

a = 1
b = 1
other = '0'

for i in range(1,4):
  if x[0] == x[i]:
    a += 1
  else:
    if other == x[i]:
      b += 1
    else:
      other = x[i]
      
print(a)
print(b)
if a == b == 2:
  print("Yes")
else:
  print("No")

x = input()

a = 1
b = 1
other = '0'

for i in range(1,4):
  if x[0] == x[i]:
    a += 1
  else:
    if other == x[i]:
      b += 1
    else:
      other = x[i]
      
if a == b == 2:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
if len(set(s)) == 2:
    for i in list(set(s)):
        if not S.count(i) == 2:
            print('No')
        else:
            print('Yes')
else:
    print('No')

S = input()
for i in S:
    if not S.count(i) ==2:
        print ('No')
        break
else:
    print ('Yes')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
a=set(map(str,input().split()))
print("Yes" if len(a)==2 else "No")

x=list(input())
a=x[0]
b=x[1]
c=x[2]
d=x[3]
if a==b and a!=c:
  if c==d:
    print(Yes)
  else:
    print(No)
elif a==c and a!=b:
  if b==d:
    print(Yes)
  else:
    print(No)
elif a==d and a!=b:
  if b==c:
    print(Yes)
  else:
    print(No)
else:
  print(No)

a=set(list(map(input().split())))
print("Yes" if len(a)==2 else "No")

x=list(input())
a=x[0]
b=x[1]
c=x[2]
d=x[3]
if a==b and a!=c:
  if c==d:
    print("Yes")
  else:
    print("No")
elif a==c and a!=b:
  if b==d:
    print("Yes")
  else:
    print("No")
elif a==d and a!=b:
  if b==c:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
c = collections.Counter(S)
values, counts = zip(*c.most_common())
a = 0
for i in counts:
    if i==2:
        a += 1
    else:
        a *= 0
if a:
    print("Yes")
else:
    print("No")


import collections
S = input()
c = collections.Counter(S)
values, counts = zip(*c.most_common())
a = 0
for i in counts:
    if i==2:
        a += 1
    else:
        a *= 0
if a:
    print("Yes")
else:
    print("No")


Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = list(input())
S.sort()
if (S[0] == S[1]) and (S[2] == S[3]):
  print(Yes)
else:
  print(No)

S = list(input())
S.sort()
if (S[0] == S[1]) and (S[2] == S[3]) and (S[1] != S[2]):
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
for i in S:
    if S.count(a[i]) == 2:
        ans += 1
if ans == 4:
    print('Yes')
else:
    print('No')

S = list(input())
S.sort()
if S[0] == S[1] and S[0] == S[2]:
    print('No')
elif S[0] == S[1] and S[2] == S[3]:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
from collections import defaultdict
S = input()
t = defaultdict(int)
for i in s:
  t[i] += 1
if len(t.keys()) == 2:
  for i in t.values():
    if i != 2:
      print("No")
      break
  else:
    print("Yes")
else:
  print("No")

from collections import defaultdict
S = input()
t = defaultdict(int)
for i in S:
  t[i] += 1
if len(t.keys()) == 2:
  for i in t.values():
    if i != 2:
      print("No")
      break
  else:
    print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
n = int(input())
p_list = list(map(int, input().split()))
count = 0
for i in range(1,len(p_list)-1):
    if p_list[i-1] < p_list[i] < p_list[i+1]:
        count += 1
    if p_list[i-1] > p_list[i] > p_list[i+1]:
        count += 1
print(count)

s = input()
if len(set(s)) == 2 and s.count(s[0]) == 2:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):

def main():
    s = input()
    s_ = list(set(s))
    if s.count(s_[0]) == 2 and len(s_) == 2i:
        print('Yes')
    else:
        print('No')
   

if __name__ == "__main__":
    main()



def main():
    s = input()
    s_ = list(set(s))
    if s.count(s_[0]) == 2 and len(s_) == 2:
        print('Yes')
    else:
        print('No')
   

if __name__ == "__main__":
    main()


Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=input()
s.sort()
ans = "NO"
if s[0]==s[1] and s[1]!=s[2] and s[2]==s[3]:
  ans="Yes"
print(ans)

s=input()
h=set()
for i in range(0,len(s)):
	h.add(s[i])
if(len(h)==2):
	print("Yes")
else:
	print("No")


Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = list(input())
s.sort()
if s[0]==s[1] and  s[2]==s[3]:
  print(Yes)
else:
  print("No")

s = list(input())
s.sort()
if s[0]==s[1] and  s[2]==s[3] and s[0]!=s[2]:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=list(set(input()));print("YES") if len(s)==2 else print("NO")

s=list(set(input()));print("Yes") if len(s)==2 else print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
# -*- coding: utf-8 -*-

def fifty_fifty(word):
    r = {}
    for s in list(word):
        if s in r:
            r[s] += 1
        else:
            r[s] = 1
    if len(r) <= 2 and max(r.values()) % 2 == 0:
        return 'yes'
    else:
        return 'no'

s = input()
print(fifty_fifty(s))

# -*- coding: utf-8 -*-

def fifty_fifty(word):
    r = {}
    for s in list(word):
        if s in r:
            r[s] += 1
        else:
            r[s] = 1
    if len(r) <= 2 and max(r.values()) % 2 == 0:
        return 'yes'
    else:
        return 'no'

if __name__ == "__main__":
    s = input()
    print(fifty_fifty(s))

# -*- coding: utf-8 -*-

def fifty_fifty(word):
    r = {}
    for s in list(word):
        if s in r:
            r[s] += 1
        else:
            r[s] = 1
    if len(r) == 2 and max(r.values()) == 2:
        return 'yes'
    else:
        return 'no'

s = input()
print(fifty_fifty(s))

# -*- coding: utf-8 -*-

def fifty_fifty(word):
    r = {}
    for s in list(word):
        if s in r:
            r[s] += 1
        else:
            r[s] = 1
    if len(r) == 2 and max(r.values()) == 2:
        return 'Yes'
    else:
        return 'No'

s = input()
print(fifty_fifty(s))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
from math import factorial

def comb(n, r):
    if n < r:
        return 0
    return factorial(n) // (factorial(n-r) * factorial(r))

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


for i in range(1, k+1):
    print(comb(n-k+1, i) * comb(k-1, i-1) % (10**9+7))





from math import factorial

def comb(n, r):
    if n < r:
        return 0
    return (factorial(n) // (factorial(n-r) * factorial(r)))

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

for i in range(1, k+1):
    print(comb(n-k+1, i) * comb(k-1, i-1) % (10**9+7))

from collections import Counter

s = input()

c = Counter(s)

if len(c) == 2:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s=list(input())
if (s[0]==s[1] or s[0]==s[2] or s[0]==s[3]) and (s[1]==s[2] or s[1]==s[3]) and s[2]==s[3]:
    print("Yes")
else:
    print("No")


s=list(input())

a=s.count(s[0])
b=s.count(s[1])
c=s.count(s[2])
d=s.count(s[3])

s=list(set(s))
#print(s)
ans1=0
if (a==3) or (b==3) or (c==3) or (d==3):
    #print("No")
    ans1=-1
if len(s)==2:
    #print("Yes")
    ans1=+1
else:
    ans1=-1
    #print("No")

if ans1==1:
    print("Yes")
else:
    print("No")

#print(a)
#print(b)
#print(c)
#print(d)

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = list(input())

if len(set(S)) != 2:
    print('NO')
elif S.count(S[0]) == 2:
    print('YES')
else:
    print('NO')

S = list(input())

if len(set(S)) != 2:
    print('No')
elif S.count(S[0]) == 2:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import sys
s = input()

s = [val for val in s]
s.sort()

a = set(s)
if len(a) != 2:
    print("NO")
    sys.exit()
if s[1] != s[2]:
    print("YES")
else:
    print("NO")


import sys
s = input()

s = [val for val in s]
s.sort()

a = set(s)
if len(a) != 2:
    print("No")
    sys.exit()
if s[1] != s[2]:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = str(input())
adic = {}

for i in range(4):
  if not s[i] in adic:
    adic[s[i]] = 1
  else:
    adic[s[i]] += 1
    
abool = True
if len(adic) == 2:
  for item in adic:
    if adic.get(item) != 2:
      abool = False
else:
  abool = False
  
if abool:
  print('YES')
else:
  print('NO')

s = str(input())
adic = {}

for i in range(4):
  if not s[i] in adic:
    adic[s[i]] = 1
  else:
    adic[s[i]] += 1
    
abool = True
if len(adic) == 2:
  for item in adic:
    if adic.get(item) != 2:
      abool = False
else:
  abool = False
  
if abool:
  print('Yes')
else:
  print('No')


Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
data = dict()
for c in s:
    if c not in data:
        data[c] = 1
    else:
        data[c] = data[c] + 1
ans = True
for d in data:
    if data[d] != 2:
        ans = False
print(ans and len(data) == 2)

s = input()
data = dict()
for c in s:
    if c not in data:
        data[c] = 1
    else:
        data[c] = data[c] + 1
ans = True
for d in data:
    if data[d] != 2:
        ans = False
print('Yes' if ans and len(data) == 2 else 'No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
if __name__ == "__main__":
    S = Counter(input())
    if len(S) == 2 and all(v == 2 for v in S.values()):
        print("Yes")
    else:
        print("No")




from collections import Counter
if __name__ == "__main__":
    S = Counter(input())
    if len(S) == 2 and all(v == 2 for v in S.values()):
        print("Yes")
    else:
        print("No")




Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
Slist=[]
for i in range(4):
    Slist.append(S[i])
Slist.sort()

if Slist[0] == Slist[1] and Slist[2] == Slist[3]:
    ans = "Yes"
else:
    ans = "No"


import math
N, K = map(int, input().split(" "))
mod = 10**9 + 7

p = math.factorial(N-K+1) * math.factorial(K-1)

for j in range(K):
    i = j+1
    
    q = math.factorial(i) * math.factorial(N-K+1-i) * math.factorial(K-i) * math.factorial(i-1)
    a=int((p/q)%mod)
    print(a)


S = input()
Slist=[]
for i in range(4):
    Slist.append(S[i])
Slist.sort()

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
N, K = map(int, input().split(' '))
red = N-K
p = 10**9+7


def comb(n, k, p):
    
    from math import factorial
    if n < 0 or k < 0 or n < k:
        return 0
    if n == 0 or k == 0:
        return 1
    a = factorial(n) % p
    b = factorial(k) % p
    c = factorial(n-k) % p
    return (a*power_func(b, p-2, p)*power_func(c, p-2, p)) % p


def power_func(a, b, p):
    
    if b == 0:
        return 1
    if b % 2 == 0:
        d = power_func(a, b//2, p)
        return d*d % p
    if b % 2 == 1:
        return (a*power_func(a, b-1, p)) % p


def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n-1)


for i in range(1, K+1):
    print(comb(red+1, i, p)*comb(K-1, i-1, p) % p)


import collections
s = input()
c = collections.Counter(s)
if list(c.values())[0] == 2 and list(c.values())[1] == 2:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()


moji = list(s)

moji.sort()

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


s = input()


moji = list(s)

moji.sort()

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


Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
Slen = len(S)
cnt=[0,0,0]
flg = True
for i in range(Slen-1):
  
  for j in range(Slen):
    if S[i]==S[j]:
      cnt[i] += 1
  
  print(i,cnt[i])
  if cnt[i] < 2 or cnt[i] > 2:
    flg = False
    print(flg)
    break

if flg == True:
  print("Yes")
else:
  print("No")

S = input()
Slen = len(S)
cnt=[0,0,0]
flg = True
for i in range(Slen-1):
  
  for j in range(Slen):
    if S[i]==S[j]:
      cnt[i] += 1
  
  if cnt[i] < 2 or cnt[i] > 2:
    flg = False
    break

if flg == True:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
for i in s:
  if s.count(i)!=2:
    print("NO")
    break
else:
  print("YES")

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

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import collections
s = input()
s = list(s)
s.sort()
count = 0
ans = collections.Counter(s)
if ans == 2:
    print("YES")
else:
    print("NO")

import collections
s = input()
s = list(s)
s.sort()
count = 0
ans = collections.Counter(s)
ans = len(ans)
if ans == 2:
    print("YES")
else:
    print("NO")

import collections
s = input()
s = list(s)
s.sort()
count = 0
ans = collections.Counter(s)
ans = len(ans)
if ans == 2:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
n=int(input())
d=list(map(int,input().split()))
dd=sorted(d)
N=dd[n-1]
sum1=0
sum2=0
count=0
for k in range(N+1):
    for i in range(n):
        if d[i]>=k:
            sum1+=1
        else:
            sum2+=1
    if sum1==sum2:
        count+=1
    sum1=0
    sum2=0
print(count)

S=input()
sum=[0,0,0,0]
for t in range(4):
    for i in range(4):
        if S[int(t)]==S[int(i)]:
            sum[int(i)]+=1
if sum[0] == 2 and sum[1] == 2 and sum[2] == 2 and sum[3] == 2:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = list(input()).sort()
if s[0] == s[1] and s[2] == s [3]:
  print("Yes")
else:
  print("No")

s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s [3] and s[0] != s[2]:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
S = sorted(S)
if S[0] == S[1] and S[2] == S[3] and S[1] != S[2] :
    print('YES')
else :
    print('NO')

S = input()
S = sorted(S)
if S[0] == S[1] and S[2] == S[3] :
    print('YES')
else :
    print('NO')

S = input()
buf = 0
for i in range(len(S)) :
    for j in range(i+1,len(S)) :
        if S[i] == S[j] :
            buf += 1

if buf == 2 :
    print('YES')
else :
    print('NO')

S = input()
buf = 0
for i in range(len(S)) :
    for j in range(i+1,len(S)) :
        if S[i] == S[j] :
            buf += 1
 
if buf == 2 :
    print('Yes')
else :
    print('No')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
N = input()
S = sorted(N)
flag = True
if S[0] != S[1]:
  flag = False
if S[2] != S[3]:
  flag = False
if S[1] == S[2]:
  flag = False
if flag == True:
  print("YES")
else:
  print("NO")

N = input()
S = sorted(N)
flag = True
if S[0] != S[1]:
  flag = False
if S[2] != S[3]:
  flag = False
if flag == True:
  print("YES")
else:
  print("NO")

S = input()
S.sort()
flag = True
if S[0] != S[1]:
  flag = False
if S[2] != S[3]:
  flag = False
if flag == True:
  print("YES")
else:
  print("NO")

N = input()
S = sorted(N)
flag = True
if S[0] != S[1]:
  flag = False
if S[2] != S[3]:
  flag = False
if S[1] == S[2]:
  flag = False
if flag == True:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = input()
if s[0] == s[1] and s[2] ==s[3] and s[1] !=s[2]:
  print("YES")
if s[0] == s[2] and s[1] ==s[3] and s[1] !=s[2]:
  print("YES")
if s[0] == s[3] and s[1] ==s[3] and s[1] !=s[0]:
  print("YES")
else:
  print("NO")

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[2]:
  print("Yes")
elif s[0] == s[3] and s[1] ==s[2] and s[1] !=s[0]:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

S = list(input())[:4]
S.sort()
print(S)
if S[0]==S[1] and S[2]==S[3] and S[0] != S[2]:
        print('Yes')
else:
        print('No')

import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

S = input()
ans = 0
if S.count(S[0]) == 2:
    for i in range(1,4):
        if S[0] != S[i] and S.count(S[i]) == 2:
            ans = 1

yn(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
import numpy as np

S = input()

moji = [i for i in S]

a = moji[0]
for i in range(len(moji)):
    if a != moji[i]:
        b = moji[i]
count = 1
count2 = 1
for i in range(1,len(moji)):
    if moji[i] == a:
        count += 1
    elif moji[i] == b:
        count2 += 1
if count == 2 and count2 == 2:
    print("Yes")
else:
    print("No")

import numpy as np

S = input()

moji = [i for i in S]

a = moji[0]
for i in range(len(moji)):
    if a != moji[i]:
        b = moji[i]
count = 0
count2 = 0
for i in range(0,len(moji)):
    if moji[i] == a:
        count += 1
    elif moji[i] == b:
        count2 += 1
if count == 2 and count2 == 2:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = input()
for c in S:
  if c.count != 2:
    print('No')
    exit(0)
print('Yes')

S = input()
flag = True
for c in S:
    if S.count(c) != 2:
        flag = False
print('Yes') if flag else print('No')


Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = list(input())
print('Yes' if len(set(S))==2 and S.count(S[0]==2) else 'No')

S = list(input())
print('Yes' if len(set(S))==2 and S.count(S[0])==2 else 'No')


Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = str(input())

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

S = str(input())

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

S = str(input())
S = sorted(S)

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
n,m = map(int,input().split())
a = []
mod = 10**9+7
for i in range(m):
    b = int(input())
    a.append(b)
d = [0 for i in range(n+1)]
d[0] = 0
d[1] = 1
d[2] = 2
for i in range(3,n+1):
    d[i] = d[i-1] + d[i-2]
ans = 1
if a[0] == 1:
    ans = 1
else:
    ans = ans*d[a[0]-1]%mod
for i in range(m-1):
    ans = ans*d[a[i+1]-a[i]-2]%mod
ans = ans*d[n-a[m-1]-1]%mod
print(ans)

S = input()
s = list(S)
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[1] != s[2] :
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
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")

S = input()
# print(S)
list(S).sort()
# print(S)

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

S = input()
A=list(S)
A.sort()
# S=list(S).sort()
# print(list(S))

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
s = list(input())

cnt = {}

for i in s:
    if i in cnt:
        cnt[i] += 1
    else:
        cnt[i] = 1

if len(cnt) == 2 & cnt[s[0]] == 2:
    print('ok')
else:
    print('no')

s = list(input())

cnt = {}

for i in s:
    if i in cnt:
        cnt[i] += 1
    else:
        cnt[i] = 1

if len(cnt) == 2 & cnt[s[0]] == 2:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
N, K = map(int,input().split())
H=10 ** 9 + 7
ans=N-K+1
print(ans)
for i in range(1,K):
    P=(N-K-i+1)/(i+1)
    Q=(K-i)/i
    if ans< H :
        ans=int(ans*P*Q)
        print(ans)
    else:
        ans=int(ans*P*Q % H)
        print(ans)

S=input()
if len(set(S)) == 2 and S.count(S[0]) ==2:
    print("Yes")     
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = sorted(input())
print('Yes' if set(S)==2 and S.count(S[0])==2 else 'No')

print('Yes' if len(set(input()))==2 and S.count(S[0])==2 else 'No')

S = input()
print('Yes' if len(set(S))==2 and S.count(S[0])==2 else 'No')

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[int(n/2)]-s[int(n/2-1)])

s=input()
d={}
for ss in s:
  d[ss]=0
for ss in s:
  d[ss]+=1
if len(d.keys())==2:
  f=True
  for k in d:
    if d[k]!=2:
      f=False
  if f :
    print("Yes")
  else:
    print("No")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = str(input())
s = list(S)
if s[0] == s[1]:
    if s[2] == s[3]:
        print("Yes")
    else:
        print("No")
else if s[0] == s[2]:
    if s[1] == s[3]:
        print("Yes")
    else:
        print("No")
else if s[0] == s[3]:
    if s[1] == s[2]:
        print("Yes")
    else:
        print("No")

S = str(input())
s = list(S)
if s[0] == s[1]:
    if s[2] == s[3]:
        print("Yes")
else:
    print("No")
    

S = str(input())
s = list(S)

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


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S=input()
d={}
for i in S:
    if i not in d:
        d[i]=1
    else:
        d[i]+=1
v=list(d.values())
if len(d)==2:
    if (v[0]==2)and(v[1]==2):
        print("YES")
    else:
        print("NO")
else:
    print("NO")

s=input()
s=sorted(s)
if s[0]==s[1] and s[2]==s[3]:
    if s[0]==s[2]:
        print("No")
    else:
        print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a 4-character string S consisting of uppercase English letters. Determine if S consists of exactly two kinds of characters which both appear twice in S.

Submission attempts (in order):
S = str(input())
L = sorted (S)
if L[0] == L[1] and L[2] == L[3] :
    print ('yes')
else:
    print ('No')


s = str(input())
l = sorted (s)
if l[0] == l[1] and l[2] == l[3]:
    print ('yes')
else:
    print ('No')


S = str(input())
L = sorted (S)
if L[0] == L[1] and L[2] == L[3] and L[0] != L[2]:
    print ('Yes')
else:
    print ('No')
    

Verdicts: Wrong Answer

Wrong Answer

Accepted