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):
s = input()
if(s.count('F') == 2 and s.count('E') == 2):
  print("Yes")
else:
  print("No")

s = input()
d = {}
for i in range(4):
  t = s[i:i+1]
  try:
    d[t] += 1
  except:
    d[t] = 1
if(len(d) == 2):
  frag = True
  for i in range(2):
    if(d[i] != 2):
      frag = False
  if(frag):
    print("Yes")
  else:
    print("No")
else:
  print("No")

s = input()
s1 = s[:1]
for i in range(1, 4):
  if(s[i:i+1] != s1):
    s[i:i+1] = s2
if(s.count(s1) == 2 and s.count(s2) == 2):
  print("Yes")
else:
  print("No")

s = input()
s1 = s[:1]
for i in range(1, 4):
  if(s[i:i+1] != s1):
    s2 = s[i:i+1]
if(s.count(s1) == 2 and s.count(s2) == 2):
  print("Yes")
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 = list(input())
r = S[0]
for i in range(4)
 S.remove(r)
if S[0] == S[1] and len(S) == 2:
 print('Yes')
else:
 print('NO')

S = list(input())
r = S[0]
for i in range(4):
 S.remove(r)
if S[0] == S[1] and len(S) == 2:
 print('Yes')
else:
 print('NO')

S = set(input())
print('Yes' if len(S) == 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):
n,m=map(int,input().split())

def conbi(arg1, arg2):
    k=1
    l=1
    for i in range(arg2):
        k=k*(arg1-i)
        l=l*(i+1)
    if arg1==0:
        k=1
    return k/l
        
for i in range(1,m+1):
    print(int(conbi(n-m+1,i)*conbi(m-1,i-1))%(1000000007))

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

def conbi(arg1, arg2):
    k=1
    l=1
    if arg2>arg1/2:
        arg2=arg1-arg2
    for i in range(arg2):
        k=k*(arg1-i)
        l=l*(i+1)
    if arg1==0:
        return 1
    else:
        return k/l
        
for o in range(1,m+1):
    print(int((conbi(n-m+1,o)%(1000000007))*(conbi(m-1,o-1)%(1000000007))))

s=input()
st=[]
d=[]
for i in s:
    if i in d:
        st[d.index(i)]+=1
    else:
        d.append(i)
        st.append(1)

if len(st)==2 & st[0]==2 & st[1]==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 = input()

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

S = input()

if (S[0]==S[1] and S[2]==S[3] and S[0]!=S[2]) or \
(S[0]==S[2] and S[1]==S[3] and S[0]!=S[1]) or \
(S[0]==S[3] and S[1]==S[2] 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):
n=int(input())
water=list(map(int,input().split()))
x=[]
temp=0
for i in range(1,n,2):
    temp+=water[i]
x.append(sum(water)-2*temp)
for j in range(n-1):
    x.append(2*water[j]-x[-1])
res=map(str,x)
print(' '.join(res))

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

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

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()
s.sorted()
if s.count(s[0]) == s.count(s[-1]):
  print('Yes')
else:
  print('No')


s = input()
s.sort()
if s.count(s[0]) == s.count(s[-1]):
  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

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())

sample = []

for moji in S:
  if moji not in sample:
    sample.append(moji)

if len(sample) == 2:
  print('YES')
else:
  print('NO')
  

S = list(input())

sample = []

for moji in S:
  if moji not in sample:
    sample.append(moji)

total = 0
if len(sample) == 2:
  for letter in S:
    if sample[0] == letter:
      total += 1
  if total == 2:
    print('YES')
  else:
    print('NO')
else:
  print('NO')

S = list(input())

sample = []

for moji in S:
  if moji not in sample:
    sample.append(moji)

total = 0
if len(sample) == 2:
  for letter in S:
    if sample[0] == letter:
      total += 1
  if total == 2:
    print('Yes')
  else:
    print('No')
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):
import collections
S=list(map(str,input()))

S=collections.Counter(S)
a=S.most_common()

print(a[0][0])

if int(len(a)) is 2:
    print("Yes")

else:
    print("No")

import collections
S=list(map(str,input()))

S=collections.Counter(S)
a=S.most_common()



if int(len(a)) is 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()
s_list = [0] * 4
s_list = sorted([c for c in s])

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

s = input()
s_list = [0] * 4
s_list = sorted([c for c in s])

if s_list[0] == s_list[1] and  s_list[1] != s_list[2] and  s_list[2] == s_list[3]:
  print('Yes')
  exit()
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()
s = list(s)
s.sort()
if s[0] == s[1] && s[2] == s[3]:
  print("Yes")
else :
  print("No")  

s= input()
if s.count(s[0]) == 2 && s.count(s[1]) == 2:
  print("Yes")
else :
  print("No")  

s = input()
s = list(s)
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[1] != s[3]:
  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 = input()
ans = 'No'
a = {x for x in s}
if len(a) == 2:
  if a.count(a[0]) == 2 and a.count(a[1]) == 2:
    ans = 'Yes'
    
print(ans)

s = input()
ans = 'No'
a = list({x for x in s})
if len(a) == 2:

  if s.count(a[0]) == 2 and s.count(a[1]) == 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 = input()
s = list(set(S))
print("Yes" if len(set(S)) == 2 and s.count(s[0]) == 2 and s.count(s[1]) == 2 else "No")

S = input()
s = list(set(S))
print("Yes" if len(set(S)) == 2 and S.count(s[0]) == 2 and S.count(s[1]) == 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 = list(input())

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

S = list(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

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

s = set(input())
print('Yes' if len(s) == 2 else '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(map(int, input().split()))

ans = 0


for i in range(n-2):
	if p[i] < p[i + 1] < p[i + 2] or p[i + 2] < p[i + 1] < p[i]:
		ans = ans + 1

print(ans)

S = input()
if S[0] == S[1] == S[2] == S[3]:
  print('No')
elif (S[0] == S[1] and S[2] == S[3]) or (S[0] == S[2] and S[1] == S[3]) or (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):
S=list(input())
ans = "No"
if(S[0] == S[1]) and (S[1] != S[2]) and (S[2] == S[3]):
  ans = "Yes"
print(ans)

S=list(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=list(input())
S.sort()
ans = "No"
if(S[0] == S[1]) and (S[1] != S[2]) and (S[2] == S[3]):
  ans = "Yes"
print(ans)

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 = str(input("Sを入力"))
S_List = list(S)

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


S = input()
S = sorted(S)
print("Yes" if S[0] == S[1] != S[2] == S[3] 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 = input()


if S.count(S[0]) == S.count(S[1]) == S.count(S[2]) == S.count(S[3]) == 2:
    print("YES")
    
else:
    print("NO")


S = input()


if S.count(S[0]) == S.count(S[1]) == S.count(S[2]) == S.count(S[3]) == 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
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

from operator import mul
from functools import reduce



def main():
    n, k = list(map(int, input().split()))
    modulo = 1000_000_000 + 7

    def cmb(n, r):
        if n < r:
            return 0
        r = min(n - r, r)
        if r == 0:
            return 1
        numer = reduce(mul, range(n, n - r, -1))
        denom = reduce(mul, range(1, r + 1))
        return numer // denom % modulo

    for i in range(1, k+1):
        
        a = cmb(k-1, i-1)
        
        b = cmb(n-k+1, i)
        print(a * b % modulo)

main()



import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

def main():
    s = input().strip()
    a = s[0] ; b = None
    c = 1 ; d = 0

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

        elif b == None:
            b = s[i]
            d += 1

        elif s[i] == b:
            d += 1

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

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 = list(input())
s_ = len(s_)

a_ = len(set(s_))

if s_ > s_:
  print('Yes')
else:
  print('No')

s = list(input())
s_ = len(s)

a_ = len(set(s))

if s_ > s_:
  print('Yes')
else:
  print('No')

s = list(input())
s_ = len(s)

a_ = len(set(s))

if s_ == a_*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):
def myInput():
  n = input()
  s = input()
  return (n, [int(i) for i in s.split()])

def func():
  n, lst = myInput()
  cnt = 0
  for i in range(1, int(n)-1):
    if min(lst[i+1], max(lst[i], lst[i-1])) == lst[i]:
      cnt+=1
    elif min(lst[i-1],max(lst[i],lst[i+1])) == lst[i]:
      cnt+=1
  return cnt

s = input()

def func(s):
  dict = {}
  for i in s:
    dict[i] = 0
  for i in s:
    dict[i] += 1
  for k in dict:
    if not dict[k] == 2:
      print("No")
      return False
  print("Yes")
  return True

func(s)

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())



for i in range(1,k+1):
    if (n-k < i):
        print(1)

    else:
        total = 1
        total2 = 1
        total3 = 1
        for j in range(i+1):
            total *= n-k+1-j
            total2 *= j+1
            total3 = int(total/total2)
            
        ww = i**(k-i-2)
        ans = ww * total3

        ans2 = ans % 1000000007

        print(ans2)
    


n,k = map(int,input().split())
mod = 10**9+7

a = [1 for i in range(2010)]

memo = 1
for i in range(1,2001):
    memo *= i
    a[i] = memo



for i in range(1,k+1):
    if not((n-k+2 > i)):
        print(0)

    else:
        memo1 = a[n-k+1]*a[k-1]
        memo2 = a[i]*a[n-k+1-i]*a[i-1]*a[k-i]

        ans2 = memo1//memo2
        print(ans2%mod)
    


s = input()

a = []
for i in s:
    a.append(i)

cnt1 = 0
cnt2 = 0
memo =24
for i in range(1,4):
    if a[0] == a[i]:
        memo = i
        break;
    

ans = "No"
if(memo != 24):
    for i in range(1,4):
        for j in range(i+1,4):
            if (i != memo and j != memo):
                if a[i] == a[j]:
                    if a[0] != a[i]:
                        ans = "Yes"
                        break;


print(ans)
                        
            
    
    
    
    


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 = input()
ans = "YES" if len(set(S)) == 2 else "NO"
print(ans)

S = input()
ans = "Yes" if len(set(S)) == 2 else "No"
print(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):
s = input()
d = {}
for e in s:
  if e in d:
    d[e] += 1
  else:
    d[e] = 1

if len(d) == 2 and set(d.values()) = {2}:
  print("Yes")
else:
  print("No")

s = input()
d = {}
for e in s:
  if e in d:
    d[e] += 1
  else:
    d[e] = 1

if len(d) == 2 and set(d.values()) == {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()
c = collections.Counter(s)

if [2,2] == [x for x in c.values()]:
  print('Yes')
else:
  print('No')

import collections
s = input()
c = collections.Counter(s)

if [2,2] == [x for x in c.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=sorted(input())
print(S)
if len(set(S)) ==2 and S[0] == S[1] and S[1] != S[2] and S[2] == S[3]:
	print('Yes')
else:
	print('No')

S=sorted(input())
if len(set(S)) ==2 and S[0] == S[1] and S[1] != S[2] and S[2] == S[3]:
	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().split()
b = list(set(a))
if len(b) == 2:
  count = 0
  for i in range(1,3):
    if a[i] == a[0]:
      count +=1
  if count ==2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

a = str(input())
b=list(set(a))

if len(b) == 2:
  count = 0
  for i in range(1,4):
    if a[i] == a[0]:
      count +=1
  if count ==1:
    print("Yes")
  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=list(set(input()))
print(s)
if len(s)==2:
    print("YES")
else:
    print("NO")

s=list(set(input()))
if len(s)==2:
    print("YES")
else:
    print("NO")

s=list(set(input()))
if len(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):
s = input()
if s[0] == s[1] == s[2] == s[3]:
  print('No')
  break
if s[0] == s[1]:
  if s[2] == s[3]:
    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')
else:
  print('No')


s = input()
if s[0] == s[1] == s[2] == s[3]:
  print('No')
else:
  if s[0] == s[1]:
    if s[2] == s[3]:
      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')
  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 sys
sys.setrecursionlimit(100000)

N,K = map(int, input().split())
MOD = 10**9+7
A = N - K + 1

nCr = {}
def cmb(n, r):
    if n < r:
        return 0
    if r == 0 or r == n:
        return 1
    if r == 1:
        return n
    if (n,r) in nCr:
        return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

for i in range(K):
    print(cmb(K-1, i) * cmb(A, i+1) % MOD)


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(map(int ,input().split()))
S.sort()
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
  print("Yes")
else:
  print("No")

S = list(map(str ,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()
print("Bad" if S[0]==S[1] or S[1]==[2] or S[2]==S[3] else "Good")


S=sorted(input())
print('Yes' if S[0]==S[1] and S[2]==S[3] and S[0]!=S[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):
ss = input()
set_ss = set(ss)
if len(set_ss) != 2 :
  print("No")
else:
	for s in set(ss):
    	if ss.count(s) != 2:
          print("No")
          break
    else:
    	print("Yes") 

ss = input()
set_ss = set(ss)
if len(set_ss) != 2 :
  print("No")
else:
  for s in set(ss):
    if ss.count(s) != 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 = list(input())
s  = set(a)
if len(s) == 2 and a.count(s[0]) == a.count(s[1]):
  print('Yes')
else:
  print('No')


a = input()
dic = {}
if len(set(a)) == 2:
    for i in range(len(a)):
        if a[i] not in dic:
            dic.setdefault(a[i], 1)
        else:
            dic[a[i]] += 1
            if dic[a[i]] > 2:
                print('No')
                break
    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 = sorted(s)
if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print("yes")
else:
    print("No")


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


s = list(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):
S = input()
S_list = list(S[i] for i in range(len(S)))

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

else:
    print("No")



S = input()
S_list = list(S[i] for i in range(len(S)))

S_list.sort()

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

s = input()

if s[0] == s[1] and s[1] == s[2] and s[2] == s[3]:
    print("No")
else:
    if 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: 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 = int(input())
print(S)

S = list(input())
Ss = set(S)
count2 = 0
for alp in Ss:
    if S.count(alp) == 2:
        count2 += 1
if count2 == len(Ss):
    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 = sorted(s)
 
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('Yes')
else:
    print('No')

four = input()

four = sorted(four)
if four[1] = four[2] and four[3] = four[4] and four[2] != four[3]:
	print ("Yes")
else:
	print("No")

four = input()
 
four = sorted(four)
if four[1] == four[2] and four[3] == four[4] and four[2] != four[3]:
	print ("Yes")
else:
	print("No")

four = input()
 
four = sorted(four)
if four[0] == four[1] and four[2] == four[3] and four[1] != four[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):
S = input()
if len(set(S)) != 2:
    print("NO")
    exit(0)
c = 0
c0 = S[0]
for ch in S:
    if ch == c0:
        c += 1
if c == 2:
    print("YES")
else:
    print("NO")


S = input()
if len(set(S)) != 2:
    print("No")
    exit(0)
c = 0
c0 = S[0]
for ch in S:
    if ch == c0:
        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 = list(input())
A = sorted(S)
if A[0] == A[1] ! A[2] == A[3]:
  print("Yes")
else:
  print("No")

S = list(input())
A = sorted(S)
if A[0] == A[1] != A[2] == 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):
def main():
    s = list(input())
    s_unq = list(set(s))

    if len(s) == 2:
        if s.count(s_unq[0]) == 2 and s.count(s_unq[1]):
            print("Yes")
    else:
        print("No")
        
main()


def main():
    s = list(input())
    s_unq = list(set(s))

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

main()


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())
S = sorted(S)

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





S = list(input())
S = sorted(S)

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





S = list(input())
S = sorted(S)

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



S = list(input())
S = sorted(S)

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



S = list(input())
S = sorted(S)

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





S = list(input())
S = sorted(S)

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





Verdicts: Runtime Error

Wrong Answer

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):
S = list(map(str, input().split()))
check = 0

for i in range(len(S)):
  if S.count(S[i]) == 2:
    check += 1

if check == 4:
  print('Yes')
else:
  print('No')

S = input()
check = 0

for i in range(len(S)):
  if S.count(S[i]) == 2:
    check += 1

if check == 4:
  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 = int(input())
P= [int(x) for x in input().split]

answer=0
for i in range(1,N-1):
  a,b,c=P[i-1:i+2]
  if b != max(a,b,c) and b!= min(a,b,c):
    answer+=1

print(answer)

n = input()
s = sorted(list(n))
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()
c = 0
if s[0] == s[1] or s[0] == s[2] or s[0] == 3:
  c += 1
if c != 1:
  print("No")
else:
  print("Yes")

a = input()
s = [i for i in a]
for i in s:
  if s.count(i) != 2:
    print("No")
    quit()
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):
s = input()
sCnt = s.count('S')
if sCnt != 2:
    print('No')
else:
    s = s.sort()
    if s[0]=='S':
        if s[2]==s[3]:
            print('Yes')
        else:
            print('No')
    elif  s[3]=='S':
        if s[0]==s[1]:
            print('Yes')
        else:
            print('No')
    else:
        if s[1]==s[2]:
            print('Yes')
        else:
            print('No')

s = input()
s_sort = ''.join(sorted(s))
s1 = s[0]
s1cnt = s_sort.count(s1)
if s1cnt == 2:
    s2 = s[2]
    s2cnt = s_sort.count(s2)
    if s2cnt == 2:
        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())
x = {}
for i in range(4):
  if s[i] not in x.keys():
    x[s[i]] = 1
  else:
    x[s[i]] += 1
for i in x.items():
  if i != 2:
    print("No")
    exit()
print("Yes")
    

s = str(input())
x = {}
for i in range(4):
  if s[i] not in x.keys():
    x[s[i]] = 1
  else:
    x[s[i]] += 1
for i in x.values():
  if i != 2:
    print("No")
    exit()
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 sys
S = sys.stdin.readline()
S1 = S.replace(S[0],'')
if len(S1) != 2:
  print('No')
  exit()
  
S2 = S1.replace(S1[0],'')
if len(S2) == 0:
  print("Yes")
else:
  print("No")

import sys
S = sys.stdin.readline()
S1 = S.replace(S[0],'')
if len(S1) == 0:
  print('No')
  exit()
  
S2 = S.replace(S[0],'')
if len(S1)== 2 and len(S2) == 2:
  print("Yes")
else:
  print("No")

import sys
S = sys.stdin.readline()
S1 = S.replace(S[0],'')
if len(S1) == 0:
  print('No')
  exit()
  
S2 = S.replace(S[0],'')
if len(S1)== 2 and len(S2) == 0:
  print("Yes")
else:
  print("No")

import sys
S = sys.stdin.readline()
S1 = S.replace(S[0],'')
if len(S1) == 0:
  print('No')
  exit()
  
S2 = S1.replace(S1[0],'')
if len(S1)== 2 and len(S2) == 0:
  print("Yes")
else:
  print("No")

import sys
S = sys.stdin.readline()
set_S = set(S)
if len(set_S) == 2 and len(S.replace(next(iter(set_S)), "")) == 2:
  print("Yes")
else:
  print("No")

import sys
S = str(sys.stdin.readline()).strip()

S1 = S.replace(S[0],'')
if len(S1) != 2:
  print('No')
  exit()
  
S2 = S1.replace(S1[0],'')
if len(S2) == 0:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Wrong Answer

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):
s = list(input())
s.sort()

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

print(ans)

s = list(input())
s.sort()

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

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 = sorted(input())

print(S)

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

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: 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=s[0]
b=s[1]
c=s[2]
d=s[3]
if a==b and b==c:
  print('No')
else:
  if a==b and c==d:
    print('Yes')
  elif a==c and b==d:
    print('Yes')
  elif a==d and c==d:
    print('Yes')
  else:
    print('No')


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

a=n-k+1

for i in range(1,k+1):
  print(a)
  a=a*(n-k+1-i)*(k-i)//((i+1)*i)%1000000007
  




n=int(input())
L=list(map(int,input().split()))
L.sort
d=L[int(n/2)-1]-L[int(n/2)]


print(d)




s=list(input())
a=s[0]
b=s[1]
c=s[2]
d=s[3]


if a==b and c==d and a!=c:
  print('Yes')
elif a==c and b==d and a!=b:
  print('Yes')
elif a==d and c==b and a!=c:
  print('Yes')
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()
a = s[0]
b = s[1]
c = s[2]
d = s[3]

if a=b and c=d:
  print("Yes")
elif a=c and b=d:
  print("Yes")
elif a=d and b=c:
  print("Yes")
else:
  print("No")

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

if a==b==c==d:
  print("No")
elif a==b and c==d:
  print("Yes")
elif a==c and b==d:
  print("Yes")
elif a==d and b==c:
  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.sort()
if s[0] == s[1] and s[1] != s[2] and s[2] == s[3]:
  print('Yes')
else:
  print('No')

s = input()
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

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 = set(s)
if len(ss) == 2:
  print('YES')
else:
  print('NO')

s = input()
ss = set(s)
if len(ss) == 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()
s.sort()
if s[0] == s[1] and s[0] != s[2] and s[2] == s[3]:
  print('Yes')
else:
  print('No')

s = list(input().split())
s.sort()

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

s = list(input())
s.sort()
if s[0] == s[1] and s[0] != s[2] and s[2] == s[3]:
  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())
print("Yes" if len(sorted(S))==2 else "No")

S=list(input())
print("Yes" if len(set(S))==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):
n=int(input())
data=input().split()

count=0
for i in range(1,n-1):
  if int(data[i])>int(data[i-1]) and int(data[i])<=int(data[i+1]):
    count=+1
  elif int(data[i])<int(data[i-1]) and int(data[i])>=int(data[i+1]):
    count+=1

print(count)


data=input().split()
if data[0]==data[1] and data[2]==data[3]:
  print("Yes")
elif data[0]==data[2] and data[1]==data[3]:
  print("Yes")
elif data[0]==data[3] and data[1]==data[2]:
  print("Yes")
else:
  print("No")

data=input()
if data[0]==data[1] and data[2]==data[3] and data[0]!=data[2]:
  print("Yes")
elif data[0]==data[2] and data[1]==data[3] and data[0]!=data[1]:
  print("Yes")
elif data[0]==data[3] and data[1]==data[2] and data[0]!=data[1]:
  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 = sorted(list(input()))
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('YES')
else:
    print('NO')

S = int(input()).sort()
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('YES')
else:
    print('NO')

S = sorted(list(input()))
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('Yes')
else:
    print('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):
N=int(input())
L=list(input().split())
NL=sorted(L)
P=int(NL[int(N/2)-1])
Q=int(NL[int(N/2)])
print(Q+1-P)
print(L[1])

N=int(input())
L=list(input().split())
NL=sorted(L)
P=int(NL[int(N/2)-1])
Q=int(NL[int(N/2)])
print(Q+1-P)

N=int(input())
L=list(input().split())
NL=sorted(L)
P=int(NL[int(N/2)-1])
Q=int(NL[int(N/2)])
print(Q+1-P)

S=input()
L=[str(c) for c in S]
if L[0]==L[1]==L[2]==L[3]:
  print("No")
elif L[0] ==L[1]:
  if L[2]==L[3]:
    print("Yes")
  else:
    print("No")
elif L[0]==L[2]:
  if L[1]==L[3]:
    print("Yes")
  else:
    print("No")
elif L[0]==L[3]:
  if L[1]==L[2]:
    print("Yes")
  else:
    print("No")
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):
list_a=[]
if len(list_a) !=AABB:
  print('ok')
else:
  print('no')

s=input()

if s[0] == s[1] and s[2] == s[3] and s[0] !=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')

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

s=input()

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

Verdicts: Runtime Error

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()
t = [s[0], s[1], s[2], s[3]]
u = list(set(t))
v = len(u)
w = s.count(u[0])
x = s.count(u[1])
if v != 2:
    print("No")
else:
    w = s.count(u[0])
    x = s.count(u[1])
    if w == 2 and x ==2:
	print("Yes")
    else:
	print("No")

s = input()
t = [s[0], s[1], s[2], s[3]]
u = list(set(t))
v = len(u)
if v != 2:
    print("No")
else:
    w = s.count(u[0])
    x = s.count(u[1])
    if w == 2 and x ==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()
if((s[0]==s[1] and s[2]==s[3] and s[0]!=s[2]) or (s[0]==s[2] and s[1] ==s[3] and s[0]!=s[1])
   and (s[0]==s[3] and s[1]==s[2] and s[0]!=s[1])):
  print("Yes")
else:
  print("No")


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

s = input()
if((s[0]==s[1] and s[2]==s[3] and s[0]!=s[2]) or (s[0]==s[2] and s[1] ==s[3] and s[0]!=s[1])
   or (s[0]==s[3] and s[1]==s[2] and s[0]!=s[1])):
  print("Yes")
else:
  print("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):
ss=input().strip()
d={}
for s in ss:
  d[s]=d.get(s,0)+1

flg=False
for s in ss:
  if d[s]!=2:
    flg=True
print("Yes" if flg else "No")

ss=input().strip()
d={}
for s in ss:
  d[s]=d.get(s,0)+1

flg=False
for s in ss:
  if d[s]!=2:
    flg=True
print("No" if flg else "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):
s = input()
flag = 0

if s[0] == s[1] and s[2] == s[3]:
    flag = 1
elif s[0] == s[2] and s[1] == s[3]:
    flag = 1
elif s[0] == s[3] and s[1] == s[2]:
    flag = 1

if flag == 1:
    print("YES")
else:
    print("NO")

s = input()
flag = 0

if s[0] == s[1] and s[2] == s[3]:
    if s[1] != s[2]:
        flag = 1
elif s[0] == s[2] and s[1] == s[3]:
    if s[1] != s[2]:
        flag = 1
elif s[0] == s[3] and s[1] == s[2]:
    if s[0] != s[1]:
        flag = 1

if flag == 1:
    print("YES")
else:
    print("NO")

s = input()
flag = 0

if s[0] == s[1] and s[2] == s[3]:
    if s[1] != s[2]:
        flag = 1
elif s[0] == s[2] and s[1] == s[3]:
    if s[1] != s[2]:
        flag = 1
elif s[0] == s[3] and s[1] == s[2]:
    if s[0] != s[1]:
        flag = 1

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

s = input()
if s[0]==s[1] and s[0]!=s[2] and s[2]==s[3]:
    print("Yes")
elif s[0]==s[2] and s[0]!=s[1] and s[1]==s[3]:
    print("Yes")
elif s[0]==s[3] and s[0]!=s[1] and 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):
for i in range(1,4):
    if s[0] == s[i]:
        for j in range(2,4):
            if s[1] == s[j]
    else:
        print("No") 
        exit()
print("Yes")

s = input()
sorted(s)

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

s = int(input())

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

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

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

s = int(input())
sorted(s)

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

s = int(input())

for i in range(1,4):
    if s[0] == s[i]:
        for j in range(2,4):
            if s[1] == s[j]
    else:
        print("No") 
        exit()
    print("Yes")

s = input()
s_list = list(s)
s_list.sort()

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

Verdicts: Runtime Error

Wrong Answer

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):
import math

def nCr(n,r):
    f = math.factorial
    return int(f(n) / f(r) / f(n-r))

def nHk(n, k):
    f = math.factorial
    return int(f(n + k - 1) // f(k) // f(n - 1))

N, K = map(int, input().split())
MOD = 10 ** 9 + 7

for i in range(1, K + 1):
#   print('i: ' + str(i))
    
    blue = 1

#        blue = 1
#    else:

#    print('blue: ' + str(blue))
    
    if (N - K) < (i - 1):
        red = 0
#        print('red0: ' + str(red))
    elif i == 1:
        red = (N - K) + 1
#        print('red1: ' + str(red))
    else:
        red = nCr(K - 1, i - 1) * nHk(i + 1, N - K - (i - 1))

#        print('nHk: ' + str(nHk(i + 1, N - K - (i - 1))))
#        print('red2: ' + str(red))

    
    ans = blue * red % MOD
#    print(ans)
    print('ans: ' + str(ans))

S = list(input())
s = list(set(S))
ans = 'No'
if len(s) == 2:
    if S.count(s[0]) == 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=input()
if S[0] == S[1]:
  if S[2] == S[3]:
    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")
else:
  print("NO")

S=input()
if S[0] == S[1] == S[2] == S[3]:
  print("No")
else:
  if S[0] == S[1]:
    if S[2] == S[3]:
      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")
  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()
hantei=False
if(len(set(S))==2):
    if(SS[0]==SS[1] and SS[0]!=SS[2]):
        hantei=True
    else:
        hantei=False
else:
    hantei=False
SS=sorted(S)

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

S=input()
hantei=False
SS=sorted(S)
if(len(set(S))==2):
    if(SS[0]==SS[1] and SS[0]!=SS[2]):
        hantei=True
    else:
        hantei=False
else:
    hantei=False


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

Verdicts: Runtime Error

Accepted