TnT/CodeNet4Repair huggingface dataset:
Problem:
仲良し 5 人組でじゃんけんをすることになりました。じゃんけんとは、グー、チョキ、パーという 3つの手があり、グーとチョキの勝負ならグーが「勝ち」・チョキが「負け」、チョキとパーなら、チョキが「勝ち」・パーが「負け」、パーとグーならパーが「勝ち」・グーが「負け」というルールです。全員が同じ手、またはグー、チョキ、パー全てが出た場合は「あいこ」となります。  5 人のじゃんけんの手を入力とし、それぞれの人の勝敗を出力するプログラムを作成してください。じゃんけんの手は、グーは 1、チョキは 2、パーは 3 の数字で表します。勝敗は「勝ち」を 1、「負け」を 2、「あいこ」を 3 の数字で表し、入力順に従って出力します。

Incorrect submission (verdict: Wrong Answer):
# -*- coding: utf-8 -*-
#import pdb;    pdb.set_trace()
import sys

def solv(v):
    w = set(v)
    if len(w)==1 or len(w)==3:
        d={1:2, 2:2, 3:2}
    elif 1 in w and 2 in w:
        d={1:1, 2:2}
    elif 2 in w and 3 in w:
        d={2:1, 3:2}
    else:
        d={3:1, 1:2}
    return(list(map(lambda x:d[x], v) ))
def main():
    if True:
        fh = sys.stdin
    else:
        fh = open('vol2_0205.txt', 'r')
    try:
        while True:
            te = []
            for _ in range(5):
                x=int(fh.readline().strip())
                if x==0:
                    raise Exception
                te.append(x)
            b=(solv(te))
            for i in b:
                print(i)
    except Exception:
        1
    fh.close()
    
if __name__ == '__main__':
    main()



Fixed, accepted submission:
# -*- coding: utf-8 -*-
#import pdb;    pdb.set_trace()
import sys

def solv(v):
    w = set(v)
    if len(w)==1 or len(w)==3:
        d={1:3, 2:3, 3:3}
    elif 1 in w and 2 in w:
        d={1:1, 2:2}
    elif 2 in w and 3 in w:
        d={2:1, 3:2}
    else:
        d={3:1, 1:2}
    return(list(map(lambda x:d[x], v) ))
def main():
    if True:
        fh = sys.stdin
    else:
        fh = open('vol2_0205.txt', 'r')
    try:
        while True:
            te = []
            for _ in range(5):
                x=int(fh.readline().strip())
                if x==0:
                    raise Exception
                te.append(x)
            b=(solv(te))
            for i in b:
                print(i)
    except Exception:
        1
    fh.close()
    
if __name__ == '__main__':
    main()
Problem:
Print all the integers that satisfies the following in ascending order:    * Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.

Incorrect submission (verdict: Wrong Answer):
A,B,K = map(int, input().split())
num = B-A+1
lis = []
ans = []

for i in range(num):
    lis += str(A)
    A += 1

n=0
for j in range(K):
    if j <= B-2:
        ans += lis[j]
        if j == B:
            break
        
num = B-A
for l in range(K):
    if A > l+2:
        ans += lis[num-l]
        if l == A:
            break

uniq_ans = []
for m in ans:
    if m not in uniq_ans:
        uniq_ans.append(m)        

print(uniq_ans)
uniq_ans.sort()

for n in uniq_ans:
        print(n)

Fixed, accepted submission:




A,B,K = map(int, input().split())


    
lis = []
for i in range(A, A+K):
    if i <= B:
        lis.append(i)


    
for j in range(B-K+1, B+1):
    if j >= A:
        lis.append(j)


ans_set = set(lis)


ans_list = list(ans_set)


ans_list.sort()


for n in ans_list:
        print(n)
Problem:
M-kun has the following three cards:    * A red card with the integer A.   * A green card with the integer B.   * A blue card with the integer C.  He is a genius magician who can do the following operation at most K times:    * Choose one of the three cards and multiply the written integer by 2.  His magic is successful if both of the following conditions are satisfied after the operations:    * The integer on the green card is **strictly** greater than the integer on the red card.   * The integer on the blue card is **strictly** greater than the integer on the green card.  Determine whether the magic can be successful.

Incorrect submission (verdict: Wrong Answer):
A,B,C = map(int,input().split())
K = int(input())
while K != 0:
  if A >= B:
    B *= 2
  elif B >= C:
    C *= 2
  K -= 1

if A < B < C:
  print("YES")
else:
  print("NO")

Fixed, accepted submission:
A,B,C = map(int,input().split())
K = int(input())
while K != 0:
  if A >= B:
    B *= 2
  elif B >= C:
    C *= 2
  K -= 1

if A < B < C:
  print("Yes")
else:
  print("No")
Problem:
Iroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.  She is shopping, and now paying at the cashier. Her total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).  However, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.  Find the amount of money that she will hand to the cashier.

Incorrect submission (verdict: Wrong Answer):
N, K = map(int,input().split())

D = list(map(int,input().split()))
OK = []
for i in range(10):
  if i not in D:
    OK.append(str(i))
print(OK)
sn = str(N)
l = len(sn)

ans = N*1
Flag = 0
while Flag == 0:
  sans = str(ans)
  if all(sans[i] in OK for i in range(len(sans))):
    Flag = 1
  else:
    ans += 1
print(ans)
      
    

Fixed, accepted submission:
N,K = map(int,input().split())
A = set(map(int,input().split()))
#A = set(A)
ok = []
for i in range(10):
  if i not in A:
    ok.append(i)
#print(ok)
while True:
  nstr = str(N)
  nstr = list(nstr)
  #print(nstr)
  Flag = True
  for x in nstr:
    x = int(x)
    if x in A:
      Flag = False
      break
  #print(Flag)
  if Flag:
    print(N)
    exit()
  else:
    N += 1
Problem:
A group of people played a game. All players had distinct scores, which are positive integers.  Takahashi knows N facts on the players' scores. The i-th fact is as follows: the A_i-th highest score among the players is B_i.  Find the maximum possible number of players in the game.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
a = 0
for i in range(n):
    a1,b1 = map(int,input().split())
    if a < a1:
        a = a1
        b = b1
print(a + b-1)

Fixed, accepted submission:
n = int(input())
a = 0
b = 0
for i in range(n):
    a1,b1 = map(int,input().split())
    if a < a1:
        a = a1
        b = b1
print(a+b)
Problem:
In _K-city_ , there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city?

Incorrect submission (verdict: Wrong Answer):
print('<入力>')
n,m = map(int,input('n m = ').split())

x = (int(n) - 1) * (int(m) - 1)

print('<出力>')
print(x)

Fixed, accepted submission:
n,m = map(int,input().split())
x = (int(n) - 1) * (int(m) - 1)
print(x)
Problem:
Write a program which solve a simultaneous equation:      ax + by = c   dx + ey = f      The program should print x and y for given a, b, c, d, e and f (-1,000 ≤ a, b, c, d, e, f ≤ 1,000). You can suppose that given equation has a unique solution.

Incorrect submission (verdict: Wrong Answer):
def main():
    p = [float(x) for x in input().split()]
    x = (p[4]*p[2]-p[1]*p[5])/(p[0]*p[4]-p[1]*p[3])
    y = (p[2]-p[0]*x)/p[1]
    print("%.3f %.3f"%(x,y))

main()


Fixed, accepted submission:
def main():
    while 1:
        try:
            p = [float(x) for x in input().split()]
            x = (p[4]*p[2]-p[1]*p[5])/(p[0]*p[4]-p[1]*p[3])
            y = (p[2]-p[0]*x)/p[1]
        except:
            break
        if abs(x)<1e-4:
            x=0.0
        if abs(y)<1e-4:
            y=0.0
        print("{:.3f} {:.3f}".format(x,y))

main()
Problem:
Iroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.  She is shopping, and now paying at the cashier. Her total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).  However, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.  Find the amount of money that she will hand to the cashier.

Incorrect submission (verdict: Wrong Answer):
n,k=map(int, input().split())
l1=map(int,input().split())
l2=[0,1,2,3,4,5,6,7,8,9]
l3=set(l1)^set(l2)
m=str(n)
l4=map(int,set(m))
l4=set(l4)
def check(a,b):
    if (a|b)==a:
        return True
    else:
        return False
while check(l3,l4) is False:
    n=n+1
    m=str(n)
    l4=map(int,set(m))
    l4=set(l4)
print(n+1)

Fixed, accepted submission:
n,k=map(int, input().split())
l1=map(int,input().split())
l2=[0,1,2,3,4,5,6,7,8,9]
l3=set(l1)^set(l2)
m=str(n)
l4=map(int,set(m))
l4=set(l4)
def check(a,b):
    if (a|b)==a:
        return True
    else:
        return False
while check(l3,l4) is False:
    n=n+1
    m=str(n)
    l4=map(int,set(m))
    l4=set(l4)
print(n)
Problem:
You are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different.

Incorrect submission (verdict: Wrong Answer):
S=input()
print("Yes" if len(S)==len(set(S)) else "No")

Fixed, accepted submission:
S=input()
print("yes" if len(S)==len(set(S)) else "no")
Problem:
In AtCoder Kingdom, Gregorian calendar is used, and dates are written in the "year-month-day" order, or the "month-day" order without the year.   For example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year.  In this country, a date is called _Takahashi_ when the month and the day are equal as numbers. For example, 5-5 is Takahashi.   How many days from 2018-1-1 through 2018-a-b are Takahashi?

Incorrect submission (verdict: Wrong Answer):
a, b = (input().split(" "))
a = int(a)
b = int(b)
if a<b:
    print(a)
else:
    print(a-1)

Fixed, accepted submission:
a, b = (input().split(" "))
a = int(a)
b = int(b)
if a<=b:
    print(a)
else:
    print(a-1)
Problem:
Find the largest square number not exceeding N. Here, a _square number_ is an integer that can be represented as the square of an integer.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
print(n**.5)


Fixed, accepted submission:
n = int(input())
print(int(n**.5)**2)
Problem:
Write a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:                 for i = 1 to A.length-1     key = A[i]     /* insert A[i] into the sorted sequence A[0,...,j-1] */     j = i - 1     while j >= 0 and A[j] > key         A[j+1] = A[j]         j--     A[j+1] = key   Note that, indices for array elements are based on 0-origin.  To illustrate the algorithms, your program should trace intermediate result for each step.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split(' ')))
for i in range(n):
    v=a[i]
    j=i-1
    while j>=0 and a[j]>v:
        a[j+1]=a[j]
        j=j-1
    a[j+1]=v
print(" ".join(map(str,a)))

Fixed, accepted submission:
n=int(input())
a=list(map(int,input().split(' ')))
for i in range(n):
    v=a[i]
    j=i-1
    while j>=0 and a[j]>v:
        a[j+1]=a[j]
        j=j-1
    a[j+1]=v
    print(" ".join(map(str,a)))
Problem:
There is a hotel with the following accommodation fee:    * X yen (the currency of Japan) per night, for the first K nights   * Y yen per night, for the (K+1)-th and subsequent nights  Tak is staying at this hotel for N consecutive nights. Find his total accommodation fee.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n >= k:
  print(k * x)
else:
  print(n * x + (k - n)*y)

Fixed, accepted submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n <= k:
  print(n * x)
else:
  print(k * x + (n - k)*y)
Problem:
Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either `0` or `1` is written. The number written in Square i is s_i.  Snuke will place a marble on each square that says `1`. Find the number of squares on which Snuke will place a marble.

Incorrect submission (verdict: Wrong Answer):
s = "000"
ss = s.split("1")
print(len(ss)-1)

Fixed, accepted submission:
s = str(input())
ss = s.split("1")
print(len(ss)-1)
Problem:
Determine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.

Incorrect submission (verdict: Wrong Answer):

n, k = map(int, input().split())
if k <= (n + 1) // 2:
    print("Yes")
else:
    print("No")

Fixed, accepted submission:

n, k = map(int, input().split())
if k <= (n + 1) // 2:
    print("YES")
else:
    print("NO")
Problem:
There are N positive integers written on a blackboard: A_1, ..., A_N.  Snuke can perform the following operation when all integers on the blackboard are even:    * Replace each integer X on the blackboard by X divided by 2.  Find the maximum possible number of operations that Snuke can perform.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

ans = float('inf')
for i in range(N):
    cnt = 0

    while A[i] % 2 == 0:
        A[i] = A[i] // 2
        cnt += 1    
    if ans > cnt:
        ans = cnt

print(cnt)

Fixed, accepted submission:
N = int(input())
A = list(map(int, input().split()))

res = float('inf')

for i in range(N):
    count = 0

    while A[i] % 2 == 0:
        A[i] /= 2
        count += 1

    if res > count:
        res = count

print(res)
Problem:
Write a program which reads two integers a, b and an operator op, and then prints the value of a op b.  The operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part.

Incorrect submission (verdict: Wrong Answer):
a,b,c= input().split()
a = int(a)
c = int(c)
#print(a)
#print(a,b,c)

if b == "+":
    print(a + c)
elif b == "-":
    print(a - c)
elif b == "*":
    print(a * c)
elif b == "/":
    print(a / c)
elif b == "?":
    pass



Fixed, accepted submission:
while True:
    a,b,c= input().split()
    a = int(a)
    c = int(c)
    if b == "+":
        print(a + c)
    elif b == "-":
        print(a - c)
    elif b == "*":
        print(a * c)
    elif b == "/":
        print(a // c)
    elif b == "?":
        break
Problem:
You are given three words s_1, s_2 and s_3, each composed of lowercase English letters, with spaces in between. Print the acronym formed from the uppercased initial letters of the words.

Incorrect submission (verdict: Wrong Answer):
s1,s2,s3=input().split()
S=s1[0]+s2[0]+s3[0]
S.upper()
print(S)

Fixed, accepted submission:
s1,s2,s3=input().split()
S=s1[0]+s2[0]+s3[0]
print(S.upper())
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
print(N % 1000)

Fixed, accepted submission:
N = int(input())
if N % 1000 == 0:
    print(0)
else:
    print(1000 - (N % 1000))
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
a = 0
b = 0
c = 0
d = 0

for i in range(n):
  S = list(map(str, input().split()))
  if S[0] == 'AC':
    a += 1
  if S[0] == 'WA':
    b += 1
  if S[0] == 'TLE':
    c += 1
  if S[0] == 'RE':
    d += 1
print('AC × '+str(a))
print('WA × '+str(b))
print('TLE × '+str(c))
print('RE × '+str(d))

Fixed, accepted submission:
n=int(input())
l = [input() for i in range(n)] 

ac = 0
wa = 0
tle = 0
re = 0

for i in l:
    if i == 'AC':
        ac += 1
    if i == 'WA':
        wa += 1
    if i == 'TLE':
        tle += 1
    if i == 'RE':
        re += 1

print('AC x '+str(ac))
print('WA x '+str(wa))
print('TLE x '+str(tle))
print('RE x '+str(re))
Problem:
You are given a string s. Among the **different** substrings of s, print the K-th lexicographically smallest one.  A substring of s is a string obtained by taking out a non-empty contiguous part in s. For example, if s = `ababc`, `a`, `bab` and `ababc` are substrings of s, while `ac`, `z` and an empty string are not. Also, we say that substrings are different when they are different as strings.  Let X = x_{1}x_{2}...x_{n} and Y = y_{1}y_{2}...y_{m} be two distinct strings. X is lexicographically larger than Y if and only if Y is a prefix of X or x_{j} > y_{j} where j is the smallest integer such that x_{j} \neq y_{j}.

Incorrect submission (verdict: Wrong Answer):
s = input()
n = int(input())
ans = "zzzzz"
anslist = set()
for i in range(0,5):
    for j in range(0,5):
        if i < j <= len(s):
            anslist.add(s[-j:-i])
for i in range(len(s)-5):
    if s[i:i+5] < ans:
        ans = s[i:i+5]
for i in range(1, 6):
    anslist.add(ans[0:i])
anslist = list(anslist)
anslist.sort()
if "" in anslist:
    anslist.remove("")
print(anslist[n-1])

Fixed, accepted submission:
s = input()
n = int(input())
ans = "zzzzz"
anslist = set()
for i in range(0,5):
    for j in range(0,5):
        if i < j <= len(s):
            if i != 0:
                anslist.add(s[-j:-i])
            else:
                anslist.add(s[-j:])
for i in range(len(s)-5):
    if s[i:i+5] < ans:
        ans = s[i:i+5]
for i in range(1, 6):
    anslist.add(ans[0:i])
anslist = list(anslist)
anslist.sort()
print(anslist[n-1])
Problem:
There is an empty array. The following N operations will be performed to insert integers into the array. In the i-th operation (1≤i≤N), b_i copies of an integer a_i are inserted into the array. Find the K-th smallest integer in the array after the N operations. For example, the 4-th smallest integer in the array \\{1,2,2,3,3,3\\} is 3.

Incorrect submission (verdict: Wrong Answer):
N, K = map(int, input().split())
cnt = 1
for i in range(N):
    a, b = map(int, input().split())
    if cnt <= K <= cnt + b:
        print(a) 
    cnt += b

Fixed, accepted submission:
N, K = map(int, input().split())
lis = []
for i in range(N):
    a, b = map(int, input().split())
    lis.append([a,b])
lis = sorted(lis)
cnt = 0
for x, y in lis:
    if cnt <= K <= cnt + y: 
        print(x)
        break
    else:
        cnt += y
Problem:
You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer.

Incorrect submission (verdict: Wrong Answer):
a,b = map(int,input().split())
A = (a+b)/2
print(A if (A*10)%2 == 0 else int(A+0.5))

Fixed, accepted submission:
a,b = map(int,input().split())
print((a+b-1)//2+1)
Problem:
You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer.

Incorrect submission (verdict: Wrong Answer):
a, b = map(int, input().split())
c = int((a + b) / 2)
print(c) if c == (a + b) else print(c + 1)

Fixed, accepted submission:
a, b = map(int, input().split())
c = int((a + b) / 2)
print(c) if c == ((a + b) / 2) else print(c + 1)
Problem:
Write a program which calculates the cube of a given integer x.

Incorrect submission (verdict: Wrong Answer):
def print_list(lst) :
	lst = ' '.join(list(map(str, lst)))
	print(lst)

x = input().split()
t = 3 * x
print_list(t)

Fixed, accepted submission:
x = int(input())
print(x**3)
Problem:
There are N balls placed in a row. AtCoDeer the deer is painting each of these in one of the K colors of his paint cans. For aesthetic reasons, any two adjacent balls must be painted in different colors.  Find the number of the possible ways to paint the balls.

Incorrect submission (verdict: Wrong Answer):
N, K = map(int,input().split())
print(K*K**(N-1))

Fixed, accepted submission:
N, K = map(int,input().split())
print(K*(K-1)**(N-1))
Problem:
N persons are standing in a row. The height of the i-th person from the front is A_i.  We want to have each person stand on a stool of some heights - at least zero - so that the following condition is satisfied for every person:  Condition: Nobody in front of the person is taller than the person. Here, the height of a person includes the stool.  Find the minimum total height of the stools needed to meet this goal.

Incorrect submission (verdict: Wrong Answer):

n = int(input())
a_list = list(map(int, input().split()))

_sum = 0

for e in range(len(a_list)):
    # print('aaa')
    if e != 0 :
        # print('bbb')
        if a_list[e] < a_list[e - 1] :
            # print('ccc')
            _sum = _sum + (a_list[e - 1] - a_list[e])

print(_sum)

Fixed, accepted submission:

n = int(input())
a_list = list(map(int, input().split()))

_sum = 0

for e in range(len(a_list)):
    # print('aaa')
    if e != 0 :
        # print('bbb')
        if a_list[e] < a_list[e - 1] :
            # print('ccc')
            _sum = _sum + (a_list[e - 1] - a_list[e])
            a_list[e] = a_list[e] + (a_list[e - 1] - a_list[e])

print(_sum)
Problem:
Snuke has N sticks. The length of the i-th stick is l_i.  Snuke is making a snake toy by joining K of the sticks together.  The length of the toy is represented by the sum of the individual sticks that compose it. Find the maximum possible length of the toy.

Incorrect submission (verdict: Wrong Answer):
_,n=map(int,input().split());print(sum(sorted(map(int,input().split()))[n:]))

Fixed, accepted submission:
_,n=map(int,input().split());print(sum(sorted(map(int,input().split()))[-n:]))
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
N = int(input())

print(1000-N)

Fixed, accepted submission:
N = int(input())
if 1 <= N <= 999:
  print(1000-N)
elif int(str(N)[1:]) ==0:
  print(0)
else:
    print(1000-int(str(N)[1:]))
Problem:
You are given strings s and t, consisting of lowercase English letters. You will create a string s' by freely rearranging the characters in s. You will also create a string t' by freely rearranging the characters in t. Determine whether it is possible to satisfy s' < t' for the lexicographic order.

Incorrect submission (verdict: Wrong Answer):
a = list(input().split())
b = list(input().split())

a.sort()
b.sort(reverse=True)

if ''.join(a) < ''.join(b):
  print('Yes')
else:
  print('No')

Fixed, accepted submission:
a = list(input())
b = list(input())
 
a.sort()
b.sort(reverse=True)
if ''.join(a) < ''.join(b):
  print('Yes')
else:
  print('No')
Problem:
We call a 4-digit integer with three or more consecutive same digits, such as 1118, **good**.  You are given a 4-digit integer N. Answer the question: Is N **good**?

Incorrect submission (verdict: Wrong Answer):
n = list(input())
cnt = 0
for i in range(10):
  cnt = n.count(i)
  if cnt == 3 or cnt == 4:
    print('Yes')
  else:
    print('No')


Fixed, accepted submission:
n = input()
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
  print('Yes')
else:
  print('No')
Problem:
Let w be a string consisting of lowercase letters. We will call w _beautiful_ if the following condition is satisfied:    * Each lowercase letter of the English alphabet occurs even number of times in w.  You are given the string w. Determine if w is beautiful.

Incorrect submission (verdict: Wrong Answer):
from collections import Counter

w = input()

char_counter = Counter()

for c in w:
  char_counter[c] += 1
  
print(char_counter)

is_beautiful = "YES"
for c in char_counter.most_common():
  if c[1] % 2 == 1:
    is_beautiful = "NO"

print(is_beautiful)

Fixed, accepted submission:
from collections import Counter
 
w = input()
 
char_counter = Counter()
 
for c in w:
  char_counter[c] += 1
 
is_beautiful = "Yes"
for c in char_counter.most_common():
  if c[1] % 2 == 1:
    is_beautiful = "No"
 
print(is_beautiful)