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 = sorted(list(input()))
if S[1]==S[2] and S[3]==S[4] and len(S[1])==2
print
	("YES")
else
  	print("NO")

print('YES' if len(set(input())==2 else 'NO')

print("Yes" if len(set(input()))==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):
s=input()
if len(set(s))=2 and count(s[0])=2:
    print('Yes')
else:
    print('No')
    


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

s=input()
if len(set(s))=2 and count(s[0])=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

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 count_cap(S):
    renso={"A":0,"B":0,"C":0,"D":0,"E":0,"F":0,"G":0,"H":0,"I":0,"J":0,"K":0,"L":0,"M":0,"N":0,
          "O":0,"P":0,"Q":0,"R":0,"S":0,"T":0,"U":0,"V":0,"W":0,"X":0,"Y":0,"Z":0}
    count = 0
    for a in S:
        if renso[a] == 1:
            count = count + 1
        renso[a] = renso[a]+1
    
    if count == 2:
        return "yes"
    else:
        return "no"

print(count_cap(input()))

def count_cap(S):
    renso={"A":0,"B":0,"C":0,"D":0,"E":0,"F":0,"G":0,"H":0,"I":0,"J":0,"K":0,"L":0,"M":0,"N":0,
          "O":0,"P":0,"Q":0,"R":0,"S":0,"T":0,"U":0,"V":0,"W":0,"X":0,"Y":0,"Z":0}
    count = 0
    for a in S:
        if renso[a] == 1:
            count = count + 1
        renso[a] = renso[a]+1
    
    if count == 2:
        return "Yes"
    else:
        return "No"

print(count_cap(input()))

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

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

S = input()
n = 1
if S[1] not in S[0]:
  n += 1
if S[2] not in S[0:1]:
  n += 1
if S[3] not in S[0:2]:
  n += 1
if n == 2:
  print("Yes")
else:
  print("No")


S = input()
n = 0
if S[1] not in S[0]:
  n += 1
if S[2] not in S[0,1]:
  n += 1
if S[3] not in S[0,2]:
  n += 1
if n == 2:
  print("Yes")
else:
  print("No")

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


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


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


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


Verdicts: Runtime Error

Wrong Answer

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

if len(list(set(s))) >= 3:
  print("No")
else:
  s = list(set(s))
  if count(s[0]) == count(s[1]):
    print("Yes")
  else:
    print("No")

s = input()
s_s = list(set(s))

print(s_s)

if len(s_s) >= 3 or len(s_s) == 1:
  print("No")
else:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
  else:
    print("No")

s = input()

for i in range(len(S)):
  if len(set(s)) > 3:
    print("No")
  else:
    s = list(set(s))
    if count(s[0]) == count(s[1]):
      print("Yes")
   	else:
      print("No")

s = input()
s_s = list(set(s))

print(s_s)

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

s = input()
s_s = listed(set(s))

if len(s_s) >= 3:
  print("No")
else:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
  else:
    print("No")

s = input()

for i in range(len(S)):
  if len(list(set(s))) >= 3:
    print("No")
  else:
    s = list(set(s))
    if count(s[0]) == count(s[1]):
      print("Yes")
   	else:
      print("No")

s = input()
s_s = list(set(s))

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

Verdicts: Runtime Error

Wrong Answer

Runtime Error

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

    

s = list(input())

s.sort()

if s[0] == s[1] and s[2] == s[3]:
  if s[0] != s[2] and s[1] != s[2]:
    print("Yes")
    exit()
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):
a = [x for x in input().split()]
if a[0] == a[1]:
    if a[0] != a[2] and a[2] == a[3]:
        print("Yes")
    else:
        print("No")
else:
    if 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]:
    if a[0] != a[2] and a[2] == a[3]:
        print("Yes")
    else:
        print("No")
else:
    if 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")


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

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

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

S = input()
list1 = list(S)

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

if a == b:
    if c == d and a != c:
        print("Yes")
    else:
        print("No")
elif a == c:
    if b ==d and a != b:
        print("Yes")
    else:
        print("No")
elif a == d:
    if b == c and a != b:
        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(input())
s.sort()
if s[0] == s[1] and s[1] != s[2] and s[2] == s[3]:
    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):
n = int(input())
p = [int(_) for _ in input().split()]

cnt = 0
for i in range(0, n-2):
    print(p[i], p[i+1], p[i+2])
    if (p[i] < p[i+1] < p[i+2]) or (p[i] > p[i+1] > p[i+2]):
        cnt += 1
print(cnt)

S = sorted(input())
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):
n=int(input())
li = list(map(int,input().slice()))
cnt=0
for i in range(1,n-1):
    if li[i-1]<li[i]<li[i+1]:
        cnt+=1
    elif li[i-1]>li[i]>li[i+1]:
        cnt+=1
print(cnt)

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

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=input()
a=s[0]
b=0
ac=1
bc=1
for i in range(1,4):
    if s[i]!=a:
        if s[i]!=b:
            if b==0:
                b=s[i]
            else:
                break
        else:
            bc-=1
    else:
        ac-=1
print(ac,bc)
if ac==0 and bc==0:
    print("Yes")
else:
    print("No")



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



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

s.sort()

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



b = sorted(list(input()))
if b[0] == b[1] != b[2] == b[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())
s.sort()

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

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
N=input()
d=list(map(int, input().strip().split()))
ans=0

for i in range(int(max(d)+1)):
    ABC=0
    ARC=0
    for j in range(int(N)):

        if d[j]<i:
            ABC+=1
        else:
            ARC+=1

    if ARC==ABC:
        ans+=1

print(ans)


S = input()


list_S=list(S)

if list_S[0]==list_S[1] and list_S[2]==list_S[3] and list_S[0] != list_S[2]:
    print("Yes")
elif list_S[0]==list_S[2] and list_S[1]==list_S[3] and list_S[0] != list_S[1]:
    print("Yes")
elif list_S[0]==list_S[3] and list_S[1]==list_S[2] and list_S[0] != list_S[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):
a = int(input())
b = list(map(int, input().split()))
c = sorted(b)
d = c[(a//2)]-c[(a//2)-1]
print(d)

S = input()
A = set (S)
B = len (A)
if B == 2:
    print ('yes')
else:
    print ('No')

n=int(input())
b=list(map(int,input().split()))
c=0
d=0
while c<=n-3 :
    if (b[c+1]>b[c] and b[c+1]<b[c+2]) or (b[c+1]<b[c] and b[c+1]>b[c+2]):
        d +=1
        c +=1
    else:
        c+=1

print(d)


n=int(input())
b=list(map(int,input().split()))
c=0
d=0
while c<=n-3 :
    if (b[c+1]>b[c] and b[c+1]<b[c+2]) or (b[c+1]<b[c] and b[c+1]>b[c+2]):
        d +=1
        c +=1
    else:
        c+=1

print(d)


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

Verdicts: Runtime Error

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):
ls_s = [i for i in input()]
ls_s1 = sorted(ls_s)

if ls_s1[0] == ls_s1[1] and ls_s1[2] == ls_s1[3]:
    print("YES")
else:
    print("NO")

ls_s = [i for i in input()]
ls_s1 = sorted(ls_s)

if ls_s1[0] == ls_s1[1] and ls_s1[2] == ls_s1[3] and ls_s1[1] != ls_s1[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
a1=sys.stdin.readline()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2] and len(a2)==4:
    print("Yes")
elif len(a2)==4:
    print("No")
else:
    print("Error")

import sys
a1=sys.stdin.readline()
t=a1.isupper()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if len(a2)==4 and t==True:
    if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2]:
        print("Yes")
    else:
        print("No")

import sys
a1=sys.stdin.readline()
t=a1.isupper()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if len(a2)==4 and t==True:
    if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2]:
        print("Yes")
    else:
        print("No")
else:
    print("Error")

import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if len(a2)==4 and b[0]==b[1] and b[2]==b[3] and b[1]!=b[2]:
    print("Yes")
else:
    print("No")

import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[x for x in a2]
b.sort()
if len(a2)==4 and b[0]==b[1] and b[2]==b[3] and b[1]!=b[2]:
    print("Yes")
else:
    print("No")

import sys
a1=sys.stdin.readline()
a2=list(a1)
a3 = [i for i in a1]
b=[ord(x) for x in a3]
b.sort()
if b[0]==b[1] and b[2]==b[3] and b[1]!=b[3]:
    print("Yes")
else:
    print('No')

import sys
a1=sys.stdin.readline()
a2=list(a1)
a3 = [i for i in a1]
b=[ord(x) for x in a3]
b.sort()
if b[0]==b[1] and b[2]==b[3] and b[1]!=b[3]:
    print("Yes")
else:
    print('No')

import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if len(a2)==4 and (b[0]>=65 and b[0]<=90) and (b[1]>=65 and b[1]<=90) and (b[2]>=65 and b[2]<=90) and (b[3]>=65 and b[3]<=90):
    if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2]:
        print("Yes")
    else:
        print("No")
else:
    print("Error")

import sys
a1=sys.stdin.readline()
a2=list(a1)
a3 = [i for i in a1]
b=[ord(x) for x in a3]
b.sort()
if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3]:
    print("Yes")
else:
    print('No')


import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2] and len(a2)==4:
    print("Yes")
elif len(a2)==4:
    print("No")
else:
    print("Error")

import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if len(a2)==4:
    if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2]:
        print("Yes")
    else:
        print("No")
else:
    print("Error")

import sys
a1=sys.stdin.readline()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if b[0]==b[1] and b[2]==b[3] and b[0]!=b[3] and b[1]!=b[2] and len(a2)==4:
    print("Yes")
else:
    print('No')

a1=input()
a2=list(a1)
b=[ord(x) for x in a2]
b.sort()
if len(a2)==4 and b[0]==b[1] and b[2]==b[3] and b[1]!=b[2]:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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

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



bits = [format(i,'b').zfill(N) for i in range(2**N)]

ans = [0 for i in range(k)]

for item in bits:
    if item.count('1') != k:
        continue;
    else:
        i_prev = "0"
        count = 0
        for i in item:
            if i == "1" and i_prev == "0":
                count += 1
            i_prev = i
        ans[count-1] += 1


#     print(i % 1000000007 )

print(ans)



s = input()

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

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


Verdicts: Runtime Error

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

Submission attempts (in order):
S = input()
S_list = list(S)
print(S_list)
df = "Yes"
for i in range(0, 3):
    if S_list.count(S_list[i]) != 2:
        df = "No"
print(df)

S = input()
S_list = list(S)
df = "Yes"
for i in range(0, 3):
    if S_list.count(S_list[i]) != 2:
        df = "No"
print(df)

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 = [int(x) for x in input().split(' ')]
m = 10**9 + 7
import math
def combination(n, r):
  return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
  
n = min(K, N-K+1)
for k in range(1, n+1):
  print(combination(N-K+1, k) * combination(K-1, k-1) % m)


S = input()
if all([S.count(x) == 2 for x in set(S)]):
  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] & s[2]==s[3]):
  print("Yes")
elif(s[0]==s[2] & s[1]==s[3]):
  print("Yes")
elif(s[0]==s[3] & s[1]==s[2]):
  print("Yes")
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[3]):
  print("Yes")
elif(s[0]==s[3] and s[1]==s[2] and s[0]!=s[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()
se = list(set(s))
if len(se) != 2:
    print('No')
elif s.count(se[0]) == 2:
    print('No')
else:
    print('Yes')

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
s = input()
s = [ t for t in s ]
so = set(s)
 
if len(so) == 2 and  [ s.count(c) for c in so ] == [2,2] :
  print("yes")
else:
  print("No")

print(s)

s = input()
s = [ t for t in s ]
so = set(s)

if len(so) == 2 and  [ s.count(c) for c in so ] == [2,2] :
  print("yes")
else:
  print("No")



s = input()
s = [ t for t in s ]
so = set(s)
 
if len(so) == 2 and  [ s.count(c) for c in so ] == [2,2] :
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
n=int(input())
p=list(map(int,input().split()))
#print(n)
#print(p)
i=1
l=[]
while i<n-1:
  if p[i-1]<p[i]<p[i+1] or p[i-1]>p[i]>p[i+1]:
    l.append(i)
  else:
    pass
  i+=1
print(len(l))


s=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 b==c and a!=b:
  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 = int(input())
list = [int(n) for n in input().split()]

sum = 0

for i in range(1, s - 1):
    if (list[i] - list[i - 1]) * (list[i + 1] - list[i]) > 0:
        sum += 1

print(sum)


from collections import*
n, m, *t = map(int, open(0).read().split())       
*w, s, t = [a-1for a in t]         
e = [[]for _ in range(n)]        
for u, v in zip(w[::2], w[1::2]):      
    e[u].append(v)

INF = 10**10
f = [[INF]*3for _ in range(n)]        
f[s][0] = 0        
q = deque([(s, 0)])           
while q:
    vi, j = q.popleft()         
    if vi == t and j == 0:
        print(f[vi][0]//3)
        break
    for ui in e[vi]:           
        if f[ui][(j+1)%3] < INF: continue           
        f[ui][(j+1)%3] = f[vi][j] + 1
        q.append((ui, (j+1)%3))
else:
    print(-1)

s = int(input())
list = [int(n) for n in input().split()]

s_l = sorted(list)
print(s_l[s//2] - s_l[s//2 - 1])


def f_f(str):
    for s in str:
        if str.count(s) != 2:
            return False
    return True
 
S = input()
if f_f(S):
    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 = list(input())

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

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

s=input()
print("Yes" if s.count(s[0])==2 and s.count(s[1])==2 and s.count(s[2])==2 and s.count(s[3])==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):
y = sorted(input().split())
if (y[0] == y[1]) and(y[2]== y[3]):
    print('YES')
else:
    print('NO')

y = sorted(str(input()))

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

y = sorted(str(input()))

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

y = sorted(list(input()))

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

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

y = sorted(str(input()))

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

s = list(input().split())
y = sorted(s)

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

y = sorted(list(input()))

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

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

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

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

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

string = str(input())

c = collections.Counter(list(string))

if c.values == [2, 2]:
    print('Yes')

else:
    print('No')


import collections

string = str(input())

c = collections.Counter(list(string))
if list(c.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):
import math
def c(x,y):
  if x < y or y < 0:
    return 0
  elif x == 0 or y == 0:
    return 1
  else:
    s = math.factorial(n)
    t = math.factorial(n-k)
    u = math.factorial(k)
    return s//(t*u)


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

for i in range(1,k+1):
  sol = c(n-k+1,i)*c(k-1,i-1)
  m = 10**9 +7
  ans = sol%m
  print(ans)

import math
def c(x,y):
  if x < y or y < 0:
    return 0
  elif x == 0 or y == 0:
    return 1
  else:
    s = math.factorial(n)
    t = math.factorial(n-k)
    u = math.factorial(k)
    return s//(t*u)

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

for i in range(1,k+1):
  sol = c(n-k+1,i)*c(k-1,i-1)
  ans = sol%m
  print(ans)

s = str(input())

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

s = str(input())

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

from collections import defaultdict

dic = defaultdict(int)

for s in S:
    dic[s] += 1
    
if len(dic) == 2:
    for k, v in dic:
        if v == 2:
            continue
        else:
            print("No")
            exit()
    print("Yes")
else:
    print("No")

S = input()

from collections import defaultdict

dic = defaultdict(int)

for s in S:
    dic[s] += 1

if len(dic) == 2:
    for k, v in dic.items():
        if v == 2:
            continue
        else:
            print("No")
            exit()
    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 = int (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[2]:
    print('Yes')
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[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 collections

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

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

import collections

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

if all([x==2 for x in c.values()]):
    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 collections

s = list(input().rstrip())
c = colc.Counter(s)

if len(c.keys()) != 2:
  print("No")

else:
  if c.most_common()[0][1] != 2:
    print("No")
  else:
    print("Yes")

import collections
 
s = list(input().rstrip())
c = coll.Counter(s)
 
if len(c.keys()) != 2:
  print("No")
 
else:
  if c.most_common()[0][1] != 2:
    print("No")
  else:
    print("Yes")

import collections as coll
 
s = list(input().rstrip())
c = coll.Counter(s)
 
if len(c.keys()) != 2:
  print("No")
 
else:
  if c.most_common()[0][1] != 2:
    print("No")
  else:
    print("Yes")

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()
word_list = []
for i in range(len(s)):
    word_list.append(s[i])
list = []
print(word_list)

for i in range(len(word_list)):
    flag = 0
    w = word_list[i]
    if len(list) == 0:
        list.append([w,1])
    else:
        for j in range(len(list)+1):
            if j == len(list) and flag == 0:
                list.append([w,1])
            elif j == len(list):
                continue
            elif list[j][0] == w:
                flag = 1
                list[j][1] = list[j][1] + 1

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


s = input()
word_list = []
for i in range(len(s)):
    word_list.append(s[i])
list = []

for i in range(len(word_list)):
    flag = 0
    w = word_list[i]
    if len(list) == 0:
        list.append([w,1])
    else:
        for j in range(len(list)+1):
            if j == len(list) and flag == 0:
                list.append([w,1])
            elif j == len(list):
                continue
            elif list[j][0] == w:
                flag = 1
                list[j][1] = list[j][1] + 1

if len(list) == 2 and list[0][1]==2 and list[1][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):
def ABC132A(s):
    s = list(s)
    ans = True
    for i in range(len(s)):
        ans = ans and (s.count(s[i]) == 2)
    if ans:
        print("YES")
    else:
        print("NO")

ABC132A(input())


def ABC132A(s):
    ans = True
    for i in s:
        ans = ans and (s.count(i) == 2)
    if ans:
        print("Yes")
    else:
        print("No")

ABC132A(input())


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


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


s=sorted(input())
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):
N = int(input())
Plist = list(map(int,input().split()))
ctr = 0
 
for i in range(1,N-2):
  if (Plist[i] > Plist[i-1]) or (Plist[i] > Plist[i+1]):
    ctr += 1
 
print(ctr)

N = input()

for i in N:
  if N.count(i) != 2:
    print("No")
    exit()

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


count = 0
for i in range(len(A) - 2):
    if (A[i] > A[i + 1]) and (A[i + 1] > A[i + 2]):
       count += 1
    elif (A[i + 2] > A[i + 1]) and (A[i + 1] > A[i]):
        count += 1
    else: 
        pass
print(count)

import collections

s = input()

if list(collections.Counter(list(s)).values()) == [2, 2]:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

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

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
N,k=map(int,input().split())
R=N-k
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
    
for i in range(1,k+1):
  a= cmb(k-1,i-1)
  b= cmb(R+1,i)
  print(a*b)

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

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):
x = [i for i in input()]
x.sort()
print(x)
if x[0] == x[1] and x[2] == x[3] and x[1] != x[2]:
  print("Yes")
else:
  print("No")
  

x = [i for i in input()]
x.sort
if x[0] == x[1] and x[2] == x[3] and x[1] != x[2]:
  print("Yes")
else:
  print("No")
  

x = [i for i in input()]
x.sort()
if x[0] == x[1] and x[2] == x[3] and x[1] != x[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 = str(input())
S = S.sort()
if S.count(S[0]) == 2 and S.count(S[2]) == 2:
  print("Yes")
else:
  print("No")

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

Verdicts: Runtime Error

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

Submission attempts (in order):
def nCr(n,r):
    com = 1
    for i in range (1,r+1):
        com =com*(n+1-i)//i
    return com
N,K = map(int,input().split())
mod = (10**2)+7
for i in range(1,K+1):
    com1 = nCr(N - K + 1, i)
    com2 = nCr(K-1,i-1)
    print((com1*com2)%mod)

def nCr(n,r):
    com = 1
    for i in range (1,r+1):
        com =com*(n+1-i)//i
    return com
N,K = map(int,input().split())
print(nCr(N,K))
for i in range(1,K+1):
    com1 = nCr(N - K + 1, i)
    com2 = nCr(K-1,i-1)
    print((com1*com2)%(10**9+7))

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


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

sorted_S = sorted(S)

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



S = input()

sorted_S = sorted(S)

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



S = input()

sorted_S = sorted(S)

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



Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
x = int(input())
z = list(map(int,input().split()))
i = 1
num = 0
while i+1 < x:
    if z[i-1] < z[i] < z[i+1]:
        num += 1
    elif z[i+1] < z[i] < z[i-1]:
        num += 1
    i += 1
print(num)

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

Verdicts: Runtime Error

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

Submission attempts (in order):
S=input();s=set(S);print('NYoe s'[len(s)==2 and S.count(s[0])==2::2])

S=input();s=set(S);print('NYoe s'[len(s)==2 and S.count(list(s)[0])==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 = list(input())
U = []
ans = 0
for i in range(4):
  count = 0
  if count == 2:
    ans += 1
  for j in range(i, 4):
    if S[i] == S[j] and S[i] not in U:
      count += 1
    U.append(S[i])
if ans == 2:
  print("Yes")
else:
  print("No")
    
    

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
import sys
s = input()
if (len(set(list(s))) == 2):
    if s.count(s[0]) == 2:
        print("YES")
    else:
        print("NO")
else:
    print("NO")

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

import sys
s = input()
if (len(set(list(s))) == 2):
    if s.count(s[0]) == 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):
s=list(input())
d = {}
for hoge in s:
	d[hoge] = d.get(hoge, 0) + 1
for k, v in d.items():
	if(v != 2):
		print("NO")
print("YES")

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

for k, v in d.items():
  if(v != 2):
    print("NO")
print("YES")

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

for k, v in d.items():
  if(v != 2):
    print("No")
    exit()
print("Yes")

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
n, *ps = map(int, open(0).read().split())
cou =0
for x, y, z in zip(ps[:-2], ps[1:-1], ps[2:]):
  if (x-y)*(z-y)<0:
    cou += 1
print(cou)

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

Verdicts: Runtime Error

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

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


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

a = input()
if (a[0]==a[1] or a[1]==a[2] or a[2]==a[3]) and len(set(a))<3:
    print("YES")
else:
    print("No")

a = input()
if len(set(a)) ==2:
    if a.count(list(set(a))[0]) == 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):
S=input()
if S[0]!=S[2] or S[0]!=S[3]:
    if S[0]==S[1] and S[2]==S[3]:
        print('YES')
    elif S[0]==S[3] and S[2]==S[1]:
        print('YES')
    elif S[0]==S[2] and S[3]==S[1]:
        print('YES')
    else:
        print('NO')
else:
    print('NO')

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

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

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


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

if(s[0] == s[1] and s[1] == s[2] and s[2] == s[3]):
  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 = input()
sr = s.replace(s[0], '')
if len(sr) == 2 and sr[0].count == 2:
    print('Yes')
else:
    print('No')

s = input()
sr = s.replace(s[0], '')
if len(sr) == 2 and sr.count(sr[0]) == 2:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

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

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


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


Verdicts: Wrong Answer

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

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

s = sorted(input())

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

Verdicts: Wrong Answer

Accepted