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

list = []
num = []

for i in str:

    if len(list) is 0:
        list.append(i)
    else:
        if list.count(i) == 0:
                list.append(i)

print(list)

for i in list:
    num.append(str.count(i))

if len(num) is 2 and num[0]==2 and num[1]==2:
    print("Yes")
else:
    print("No")
    

    








str = input()

list = []
num = []

for i in str:

    if len(list) is 0:
        list.append(i)
    else:
        if list.count(i) == 0:
                list.append(i)



for i in list:
    num.append(str.count(i))

if len(num) is 2 and num[0]==2 and num[1]==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 = sorted(s)
if s[0] == s[1] and s[2] == s[3] and s[0] != s[1]:
  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

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()
cnt = {}
str = ''
for i in s:
    str = i
    if i in cnt:
        cnt[i] += 1
    else:
        cnt[i] = 1
print(cnt)
print('Yes' if len(set(s)) == 2 and cnt[str] == 2 else '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')

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().strip()
listS = list(S)
listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3] and listS[0] != listS[2] and l\
istS[1] != listS[3]:
    print("Yes")
else:
    print("No")

S = input().strip()
listS = list(S)
listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3] and listS[0] != listS[2] and listS[1] != listS[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().split()  

count=0

for i in S:
    for j in S:
        if i==j:
            count+=1

if count == 8:
    print('Yes')
else:
    print('No')

S = input()  

count=0

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

if count == 8:
    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):
from collections import Collecter; print('YNeos'[Counter(sorted(list(input()))).values() != [2,2]::2])

from collections import Counter; print("YNeos"[list(Counter(list(input())).values()) != [2,2]::2])

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_1 = 0
S_2 = 0
for i in range(3):
    if S_1 == 0:
        S_1 = S.count(S[i])
    else:
        S_2 = S.count(S[i])  

if S_1 == S_2 == 2:
    print('Yse')
else:
    print('No')

S = str(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[1] != S[2] and S[1] == S[3]:
    print('Yes')
elif S[0] == S[3] and S[3] != S[2] 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):
from collections import Counter as C

S = input()

c = C(S)
if len(c.keys())==2:
  if c.values[0]==2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

from collections import Counter as C
 
S = input()
 
c = C(S)
if len(c.keys())==2:
  if list(c.values())[0]==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):
n=int(input())
p=[int(i) for i in input().split()]
ans=0
for x in range(1,n-1):
    a=p[x-1]
    b=p[x]
    c=p[x+1]
    if a<b<c or c<b<a:
        ans+=1
print(ans)

import math
n,k=input().split()
n=int(n)
k=int(k)
for i in range(1,k+1):
    x=math.factorial(n-k+1)/(math.factorial(n-k+1-i)*math.factorial(i))
    y=math.factorial(k-1)/(math.factorial(k-i)*math.factorial(i-1))
    ans=x*y%(10**9+7)
    print(int(ans))

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: 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()
dic = {}
for i in s:
  if i in dic:
    dic[i] = 1
  else:
    dic[i] += 1

s = input()
dic = {}
for i in s:
  if i in dic:
    dic[i] = 1
  else:
    dic[i] += 1
if len(dic) == 2:
  print('Yes')
else:
  print('No')

s = input()
dic = {}
for i in s:
  if i in dic:
    dic[i] += 1
  else:
    dic[i] = 1
if len(dic) == 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):
def ok(s: str): str:
    char_count = {}
    for c of s:
      if c not in char_count:
        char_count[c] = 0
      if c in char_count.keys():
        chars[c] += 1
    
    yes = all([count == 2 for count in char_count.values()])
    if yes:
      return 'Yes'
    else:
      return 'No'


def ok(s: str) -> str:
    char_count = {}
    for c in s:
      if c not in char_count:
        char_count[c] = 0
      if c in char_count.keys():
        char_count[c] += 1
    
    return all([count == 2 for count in char_count.values()])

numbers_str = input()
result = ok([c for c in numbers_str])
if result:
  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(sorted(S))

flag = "Yes"

for i in S:
    if S.count(i)!=2:
        flag = "No"
        
print(flag)

S=input()
print(sorted(S))

flag = "Yes"

for i in S:
    if S.count(i)!=2:
        flag = "No"
        
print(flag)

S=input()
print(sorted(S))

flag = "YES"

for i in S:
    if S.count(i)!=2:
        flag = "NO"
        
print(flag)
        

import math
import heapq
import sys
from collections import Counter
import numpy as np





s=input()

S=sorted(s)

if S[0]==S[1] and S[2]==S[3] and S[0]!=S[3]:
    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):
s=input()
s=sorted(s)

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

s=input()
s=sorted(s)

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

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

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

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

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


S = sorted(list(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):
S = input()
if len(set(S)) == 2:
  ans = 'Yes'  
else ans = 'No'
print(ans)


S = input()
if len(set(S)) == 2:
	ans = 'Yes'  
else ans = 'No'
print(ans)

S = input()
if len(set(S)) == 2:
	ans = 'Yes'  
else:
	ans = 'No'
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=sorted(input())
print('Yes' if s[:2]==s[2:] else 'No')

s=input()
print('Yes' if len(set(s))==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):
if len(set(input().split())) == 2:
  print("Yes")
else:
  print("No")

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

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

Dict = {}

for i in range(4):
  s = S[i]
  if s in Dict:
    Dict[s] += 1
  else:
    Dict[s]=1
if len(Dict)!=2:
  print("No")
else:
  if Dict[0]!=2 or Dict[1]!=2:
    print("No")
  else:
    print("Yes")

S = input()
 
Dict = {}
 
for i in range(4):
  s = S[i]
  if s in Dict:
    Dict[s] += 1
  else:
    Dict[s]=1
    
if len(Dict)!=2:
  print("No")
else:
    List = list(Dict.values())
    if List[0]!=2 or List[1]!=2:
        print("No")
    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())
if len(set(A) == 2 & A.count(A[0]) == 2:
       print('Yes')
else:
       print('No')

A = input()
if len(set(A) == 2 & A.count(A[0]) == 2:
       print('Yes')
else:
       print('No')

A = list(input())
print('Yes' if len(set(A)) == 2 & A.count(A[0]) == 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=int(input())

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

ans= 0

for i in range(1,n-1):
    lis= sorted([li[i],li[i-1],li[i+1]])
    #print(lis)
    if lis[1]==li[i]:
        ans +=1
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 = list(input())
if (S == S[::-1]):
    print(S[::-1])
    print("Yes")
else:
    if((S[0] == S[1] and S[2] == S[3]) or (S[0] == S[2] and S[1] == S[3])):
        print("Yes")
    else:
        print("No")

S = list(input())
if (S.count(S[0]) == 4):
    print("No")
else:
    if (S == S[::-1]):
        print("Yes")
    else:
        if (S[0] == S[1] and S[2] == S[3]) or (S[0] == S[2] and S[1] == 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):
import math

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

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

for i in range(1, n-k+2):
  ans = comb(n-k+1, i) * comb(k-1, i-1)
  ans %= mod
  print(int(ans))

s = input()

for i in range(4):
    cnt = s.count(s[i])
    if(cnt != 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):
list1 = list(input())
#list1.sort()
if (list1[0]==list1[1] and list1[2]==list1[3] and list1[2]!=list1[1]):
    print("Yes")
else:
    print("No")

list1 = list(input())
list1.sort()
if (list1[0]==list1[1] and list1[2]==list1[3] and list1[2]!=list1[1]):
    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):
word = input()
dict_word = {}
for i in range(len(word)):
  try:
    count = dict_word[word[i]]
    dict_word[word[i]] += 1
  except:
    dict_word[word[i]] = 1


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

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


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

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):
t=list(input())

for i in range(1,4):
  s=t
  if s[0]==s[i]:
    z=s[0]
    s.pop(i)
    s.pop(0)
    if z!=s[0] and s[0]==s[1]:
      print("Yes")
      
print("No")

t=list(input())

for i in range(1,4):
  s=t
  if s[0]==s[i]:
    z=s[0]
    s.pop(i)
    s.pop(0)
    if z=!s[0] and s[0]==s[1]:
      print("Yes")
      
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

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())
lst=list(s)
lst.sort()
result = True

if lst[0] == lst[1]:
    if lst[2] == lst[3]:
        result = False

if result:
    print('No')
else:
    print('YES')

import math
n,k=map(int,input().split()) 
lst=list()

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

for i in range(1, k+1):
    if n-k>i:
        lst.append(combinations_count(n-k+1, i) * combinations_count(k-i+(i-1), i-1))  
    elif n-k==i:
        lst.append(combinations_count(K-1,i-1))
    else:
        lst.append(int(0))

for i in range(k):
    print(lst[i]%(10**9+7))

s=str(input())
lst=list(s)
lst.sort()
result = True

if lst[0] == lst[1]:
    if lst[2] == lst[3]:
        if lst[1] != lst[2]:
            result = False

if result:
    print('No')
else:
    print('YES')

s=str(input())
lst=list(s)
lst.sort()
result = False

if lst[0] == lst[1]:
    if lst[1] != lst[2]:
        if lst[2] == lst[3]:
            result = True

if result:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

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):
N = int(input())
p = list(map(int, input().split()))
count = 0


for i in range(0,N-2):
    if p[i] < p[i+1] and p[i+1] < p[i+2]:
        count += 1
print(count)

S = input()
SL = list(S)

if SL[0] == SL[1] and SL[1] == SL[2]:
    print('No')
elif SL[0] == SL[1] and SL[2] == SL[3]:
    print('Yes')
elif SL[0] == SL[2] and SL[1] == SL[3]:
    print('Yes')
elif SL[0] == SL[3] and SL[1] == SL[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())
if set(s)==2 and s.count(s[0]):
	print('Yes')
else:
	print('No')

s=list(input())
if len(set(s))==2 and s.count(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):
four = input()
four_set = set(four)

if len(four_set) != 2:
  print("No")
else:
  if four.count(four_set[0]) != 2:
    print("No")
  else:
    print("Yes")

four = input()
four_set = set(four)

if len(four_set) != 2:
    print("No")
else:
    if four.count(list(four_set)[0]) != 2:
        print("No")
    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):
sti = input()
up,down = False,False
for i in sti:
    if i == i.upper():
        up = True
    else:
        down = True
if up and down:
    print("Yes")
else:
    print("No")


sti = input()
up = False
down = False
for i in sti:
	if i == i.upper:
		up = True
    else:
		down = True
if up and down:
	print("Yes")
else:
  	print("No")

sti = input()
x = set()
for i in sti:
    x.add(i)
if len(x) == 2 and sti.count(sti[0]) == 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):
S = input()
temp = S[0]
a = 1
b = 0
for i in range(1,4):
  if temp == S[0]:
    a = a+1
  else:
    b = b+1
if b == 2 and a == 2:
  print('Yes')
else:
  print('No')

S = input()
temp = S[0]
temp1 = '0'
a = 1
b = 0
c = 0
for i in range(1,4):
  if temp == S[i]:
    a = a+1
  elif temp1 == S[i]:
    c = c+1
  else:
    temp1 = S[i]
    b = b+1
if b == 1 and a == 2 and c == 1:
  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):
print(["No","Yes"][set(list(input()))==2])

print(["No","Yes"][len(set(list(input())))==2])

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

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

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


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

#args = sys.argv
#S = args[0]
S = input()
print(mozi(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):
a = input()
a.sort()

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

a = sorted(input())
print("Yes") if a[0] == a[1] and a[2] == a[3] and a[1] != a[3] 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 = [int(i) for i in input().split()]
ctn = 0
for j in range(1, n-1):
    if p[j - 1] < p[j] < p[j + 1] or p[j + 1] < p[j] < p[j - 1]:
        ctn += 1
print(ctn)

s = str(input())
l = set(list(s))
if range(l) == 2:
  print("Yes")
else:
  print("No")

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

#132 a
s=list(input())
s.sort()
#print(s)
if s[0]==s[1] and s[2]==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):
a = list(input())
before = -1
count =0
for char in a:
    current = char
    if before == current:
        count = count+1
    else:
        before = current

if count==2:
    s = set()
    for item in a:
        s.add(item)
    if len(s) == 2:
        print("Yes")
        exit()

print("No")

a = list(input())
before = -1
count =0
for char in a:
    current = char
    if before == current:
        count = count+1
    else:
        before = current

if count<=2:
    s = set()
    for item in a:
        s.add(item)
    if len(s) == 2:
        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 = [s for s in S]

S.remove(S[0])

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

S = input()


t = S[0]
S = [s for s in S if s != t]


if len(S) != 2:
    print('No')
else:
    if S[0] == S[1]:
        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 S[0]==S[1] and S[2]==S[3]　and S[0]!=S[2]:
        print('Yes')

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

else :
    print('No')


S = input()
 
if S[1]==S[2]==S[3]==S[0]:
        print('No')
        
elif S[0]==S[1] and S[2]==S[3]:
        print('Yes')
 
elif S[1]==S[2] and  S[0]==S[3]:
        print('Yes')
        
elif S[1]==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):
N=input()
A=len(set(N))
if A==2 and N.count(A[0]) == N.count(A[1]) == 2:
    print("Yes")
else:
    print("No")

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


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


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 cmb(n, r):
    if n == 0 or r == 0:
        return 1
    a = b = 1
    for i in range(1, r + 1):
        a *= i
    for i in range(n-r+1,n+1):
        b *= i
    return b//a

N = list(map(int,input().split()))
M = 10**9 + 7
red = N[0]-N[1]
for i in range(1,N[1]+1):
    x = cmb(red + 1, i) * cmb(N[1] - 1,i-1)
    print(x%M)


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

def cmb(n, r):
    if n == 0 or r == 0:
        return 1
    a = b = 1
    for i in range(1, r + 1):
        print(r,i)
        a *= i
    for i in range(n-r+1,n+1):
        b *= i
    return b//a

N = list(map(int,input().split()))
M = 10**9 + 7
red = N[0]-N[1]
for i in range(1,N[1]+1):
    x = cmb(red + 1, i) * cmb(N[1] - 1,i-1)
    print(x%M)


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

a = list(input())
dic = {}
for x in a:
    dic.setdefault(x, 0)
    dic[x] += 1
if (len(dic) == 2):
    if(dic[a[0]]==2):
        print("Yes")
    else:
        print("No")
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())
s.sort()

if s[0] == s[1] and s[2] == s[3] and s[0] != 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[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 = list(input())
S.sort()
print(S)
if S[0]==S[1] and S[2]==S[3] and S[1]!=S[2]:
    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: 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()
if a[0]=a[1] and a[2]=a[3]:
  print('Yes')
elif a[0]=a[2] and a[1]=a[3]:
  print('Yes')
elif a[0]=a[3] and a[1]=a[2]:
  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()
dic = {}
for s in S:
	if not dic[s]:
		dic[s] = 1
	if dic[s]:
		dic[s] += 1
judge = 'Yes'
for k, v in dic.items():
	if v != 2:
		judge = 'NO'
print(judge)

S = list(input())
judge = 'Yes'
for s in set(S):
	if S.count(s) != 2:
		judge = 'No'
print(judge)

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

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

if len(set(input())) == 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):
l = list(input())
first = l[0]
if l.count(first) == 2:
    l.remove(first)
    l.remove(first)
    if l[0] == [1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

l = list(input())
unique_l = list(set(l))
err = False

if len(unique_l) == 2:
    for s in unique_l:
        if l.count(s) != 2:
            err = True
            break
else:
    err = True

if not err:
    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 = [x for x in input().rstrip()]

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

S = [x for x in input().rstrip()]

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()
list1 = [0,0]

a1 = S[0]
a2 = "NUM"

if S[1] == a1:
    list1[0]=2
else:
    a2 = S[1]

if S[2]==a1:
    list1[0]=2
else:
    if S[1]==a1:
        a2 =S[2]
    else:
        if S[2]==a2:
            list1[1]=2
        else:
            pass

if S[3]==a1:
    list1[0]=2
else:
    if S[2]==a1 and S[1] == a1:
        a2 = S[3]
    else:
        if S[3]==a2:
            list1[1]=2
        else:
            pass

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

list1 = [0,0]
S=""

a1 = S[0]
a2 = "NUM"

if S[1] == a1:
    list1[0]=2
else:
    a2 = S[1]

if S[2]==a1:
    list1[0]=2
else:
    if S[1]==a1:
        a2 =S[2]
    else:
        if S[2]==a2:
            list1[1]=2
        else:
            pass

if S[3]==a1:
    list1[0]=2
else:
    if S[2]==a1:
        a2 = S[3]
    else:
        if S[3]==a2:
            list1[1]=2
        else:
            pass

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

list1 = [0,0]
S=input()

a1 = S[0]
a2 = "NUM"

if S[1] == a1:
    list1[0]=2
else:
    a2 = S[1]

if S[2]==a1:
    list1[0]=2
else:
    if S[1]==a1:
        a2 =S[2]
    else:
        if S[2]==a2:
            list1[1]=2
        else:
            pass

if S[3]==a1:
    list1[0]=2
else:
    if S[2]==a1 and S[1] == a1:
        a2 = S[3]
    else:
        if S[3]==a2:
            list1[1]=2
        else:
            pass
        
if list1[1]==2 and list1[0]==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):
a=input()
ret = True
for s in a:
	sum = 0
	for t in _in:
		if s==t:
			sum += 1
	if sum != 2:
		ret = False
if ret:
	print("Yes")
else:
	print ("No")

a=input()
ret = True
for s in a:
	sum = 0
	for t in a:
		if s==t:
			sum += 1
	if sum != 2:
		ret = False
if ret:
	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
a, b, c, d = map(int, input().split())
e = (c*d)/math.gcd(c,d)
bb = b-(b//c + b//d- b//e)
aa = a-1-((a-1)//c+(a-1)//d-(a-1)//e)
z = bb-aa
print(z)

S = input()
A = sorted(S)
if A[0] == A[1] == A[2]:
    print('No')
elif A[0] == A[1] and 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):
s = input()
result = 0
count = 0
for i in s:
  if s.count(i) == 2:
    result = 0
    count+=1
  else:
  	result = 1
if result == 1 or count >2:
  print("No")
else:
  print("Yes")

n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(n-2):
  if ((p[i]>p[i+1]) and (p[i+1]>p[i+2]) and (p[i]>p[i+2])) or ((p[i]<p[i+1]) and (p[i+1]<p[i+2]) and (p[i]<p[i+2])):
    count += 1
print(count)

s = input()
result = 0
count = 0
for i in s:
  if s.count(i) == 2:
    result = 0
    count+=1
  else:
    count = 5
    break
if result == 1 or count > 4:
  print("No")
else:
  print("Yes")

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):
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')

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

s = input()
l = sorted(s)
if l[0] == l[1] and l[1] != l[2] and l[2] == l[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 = str( input() )
check = [ x == set(s)[0] for x in list(s) ]
if len( set(s) ) == 2 and sum( check ) == 2 :
   print( "Yes" )
else : 
   print( "No" )


s = list( str( input() ) )
check = [ x == s[0] for x in s ]
if len( set(s) ) == 2 and sum( check ) == 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 numpy as np
S = input()
S_ = list(set(S))
S = np.array(list(S))
S_ = np.array(S_)
print(S_)
ans = 'Yes'
if len(S_)!=2:
    ans = 'No'
elif sum(S==S_[0])!=2:
    ans = 'No'

print(ans)

import re
import numpy as np
from scipy.sparse import lil_matrix, csr_matrix

N, M = [int(i) for i in re.split(" ", input())]
G = lil_matrix((N, N), dtype=np.bool)

for i in range(M):
    u, v = [int(i) for i in re.split(" ", input())]
    G[u-1, v-1] = True
G = G.tocsr()
G = G.dot(G).dot(G)

S, T = [int(i) for i in re.split(" ", input())]

count = -1
G_tmp = G
for i in range(1, N+1):
    if i == 1:
        pass
    else:
        G_tmp = G_tmp.dot(G)
    if G_tmp[S-1, T-1]:
        count = i
        break

print(count)

import numpy as np
S = input()
S_ = list(set(S))
S = np.array(list(S))
S_ = np.array(S_)
ans = 'Yes'
if len(S_)!=2:
    ans = 'No'
elif sum(S==S_[0])!=2:
    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 = int(input())
ls = list(map(int, input().split()))

c = 0
for i in range(1, n-1):
  if ls[i] > ls[i-1] and ls[i] < ls[i+1]:
    c += 1
  elif  ls[i] < ls[i-1] and ls[i] > ls[i+1]:
    c += 1
    
print(c)

ls = list(input())
if ls[0] == ls[1] and ls[2] == ls[3] and ls[0] != ls[2]:
  print('Yes')
elif ls[0] == ls[2] and ls[1] == ls[3] and ls[0] != ls[1]:
  print('Yes')
elif ls[0] == ls[3] and ls[1] == ls[2] and ls[0] != ls[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):
import collections
S = input()
c = collections.Counter(S)
x = c.most_common()
print(x)
if x[0][1] == 2:
    if x[1][1] == 2:
        print('Yes')
    else:
        print('No')
else:
    print('No')

s = input()
for a in s:
    if s.count(a) != 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):
# -*- coding: utf-8 -*-

p=str(input())
if p[0] ==p[3] and p[1] == p[2]:
    print("YES")
elif p[0] == p[1] and p[2] == p[3]:
    print("YES")
else:
    print("NO")

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

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

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

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

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

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

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

print(d)
if len(d.keys()) == 2:
    t = True
    for e in d:
        if d[e] != 2:
            t = False
    if t:
        print("Yes")
    else:
        print("No")
else:
    print("No")


s = input()

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

print(d)
if len(d.keys()) == 2:
    print("Yes")
else:
    print("No")


s = input()

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

if len(d.keys()) == 2:
    t = True
    for e in d:
        if d[e] != 2:
            t = False
    if t:
        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):
S = [s for s in input()]
cnt = {}
for s in S:
    if s not in cnt:
       cnt[s] = 0
    cnt[s] += 1
if len(cnt) == 2 and cnt[s] == 2:
    print("YES")
else:
    print("NO")


S = [s for s in input()]
cnt = {}
for s in S:
    if s not in cnt:
       cnt[s] = 0
    cnt[s] += 1
if len(cnt) == 2 and cnt[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()
letters = list(S)
a = letters[0]
if letters.count(a) == 2:
  if letters[1] == a:
    if letters[2] == letters[3]:
      return "Yes"
    else return "No"
  else:
    b = letters[1]
    if letters.count(b) == 2:
      return "Yes"
    else:
      return "No"
    

letters = list(input())
if letters[0] == letters[1]:
  if letters.count(letters[2]) == 2:
    ans = "Yes"
  else:
    ans = "No"
else:
  ans = "No"
print(ans)

    

return "Yes"


S = list(input())
return "Yes"


while True:
    letters = list(input("input"))
    x = 1
    for letter in letters:
        if letters.count(letter) == 2:
            x *= 1
        else:
            x *= 0
    print(["No","Yes"][x])


letters = list(S)
a = letters[0]
if letters.count(a) == 2:
  if letters[1] == a:
    if letters[2] == letters[3]:
      print("Yes")
    else print("No")
  else:
    b = letters[1]
    if letters.count(b) == 2:
      print("Yes")
    else:
      print("No")
else:
  print("No")

    

letters = list(S)
a = letters[0]
if letters.count(a) == 2:
  if letters[1] == a:
    if letters[2] == letters[3]:
      return "Yes"
    else return "No"
  else:
    b = letters[1]
    if letters.count(b) == 2:
      return "Yes"
    else:
      return "No"
else:
  return "No"

    

letters = list(input())
a = letters[0]
if letters.count(a) == 2:
  if letters[1] == a:
    if letters[2] == letters[3]:
      print("Yes")
    else print("No")
  else:
    b = letters[1]
    if letters.count(b) == 2:
      print("Yes")
    else:
      print("No")
else:
  print("No")

    

letters = list(input())
true_false = 1
for letter in letters:
  if letters.count(letter) == 2:
    true_false　*= 1
  else:
    true_false *= 0
print(["No","Yes"][true_false])


letters = list(S)
a = letters[0]
if letters.count(a) == 2:
  if letters[1] == a:
    if letters[2] == letters[3]:
      return "Yes"
    else return "No"
  else:
    b = letters[1]
    if letters.count(b) == 2:
      return "Yes"
    else:
      return "No"
    

letters = list(input())
x = 1
for letter in letters:
        if letters.count(letter) == 2:
            x *= 1
        else:
            x *= 0
print(["No","Yes"][x])


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

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):
#13:48
S = input()
if S[0] in S[1:4]:
    S.strip(S[0])
    if S[0] in S[1]:
        print("Yes")
        exit()
print("No")

S = input()
if S[0] in S[1:4]:
    if S[1] in S[2:4] :
        if S[0] != S[1]:
            print("Yes")
            exit()
    elif S[2] in S[3]:
        if S[0] != S[2]:
            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):
sam = input()
tim = sorted(sam)
ans = (
    'Yes' if T[0] == T[1] and T[1] != T[2] and T[2] == T[3] else
    'No'
)
print(ans)

S = input()

T = sorted(S)
ans = (
    'Yes' if T[0] == T[1] and T[1] != T[2] and T[2] == T[3] else
    '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 = list(input());
ans = 0;

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

print(ans);

s = list(input());
ans = 0;

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

s = list(input());
ans = 0;

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

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 math

n, k = map(int, input().split())
if n > k:
	if n+1 >= 2*k:
		for i in range(k):
			j = i+1
			c_blue = (math.factorial(n-k+1))//((math.factorial(j))*(math.factorial(n-k+1-j)))
			c_div = (math.factorial(k-1))//((math.factorial(j-1))*(math.factorial(k-1-j+1)))
			comb = c_blue * c_div
			print(comb % 1000000007)
			
	else :
		for i in range(n-k+1):
			j = i+1
			c_blue = (math.factorial(n-k+1))//((math.factorial(j))*(math.factorial(n-k+1-j)))
			c_div = (math.factorial(k-1))//((math.factorial(j-1))*(math.factorial(k-1-j+1)))
			comb = c_blue * c_div
			print(comb % 1000000007)
		for _ in range(2*k -n -1):
			print(0)
else:
	print(1)
	for i in range(n-1):
		print(0)

import collections

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

flag = 0
for i in range(4):
	word = s[i]
	if c[word] != 2:
		flag = 1
		break
	
if flag == 1:
	print("No")
else :
	print("Yes")


Verdicts: Runtime Error

Accepted