TnT/CodeNet4Repair huggingface dataset:
Problem:
Takahashi is organizing a party.  At the party, each guest will receive one or more snack pieces.  Takahashi predicts that the number of guests at this party will be A or B.  Find the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.  We assume that a piece cannot be divided and distributed to multiple guests.

Incorrect submission (verdict: Wrong Answer):
import math
a, b = list(map(int, input().split()))
c = math.gcd(a, b)
d = a * b / c
d = d // 1
print(d)

Fixed, accepted submission:
import math
a, b = list(map(int, input().split()))
c = math.gcd(a, b)
d = a * b / c
d = math.floor(d)
print(d)
Problem:
You are given an integer N.  Find a triple of positive integers h, n and w such that 4/N = 1/h + 1/n + 1/w.  If there are multiple solutions, any of them will be accepted.

Incorrect submission (verdict: Time Limit Exceeded):
N=int(input())
for i in range(1,3501):
    for j in range(1,3501):
        if N*((i+j)/(i*j))/4==int(N*((i+j)/(i*j))/4):
            h=i
            n=j
            w=int(N*((i+j)/(i*j))/4)
            break
print(h,n,w)

Fixed, accepted submission:
N=int(input())
for i in range(1,3501):
    for j in range(i,3501):
        bw=4*i*j-N*i-N*j
        if bw<=0:
            continue
        if (N*i*j)%bw==0:
            print(i,j,(N*i*j)//bw)
            exit()
Problem:
CODE FESTIVAL 2016 is going to be held. For the occasion, Mr. Takahashi decided to make a signboard.  He intended to write `CODEFESTIVAL2016` on it, but he mistakenly wrote a different string S. Fortunately, the string he wrote was the correct length.  So Mr. Takahashi decided to perform an operation that replaces a certain character with another in the minimum number of iterations, changing the string to `CODEFESTIVAL2016`.  Find the minimum number of iterations for the rewrite operation.

Incorrect submission (verdict: Wrong Answer):
S = input()
T = 'CODEFESTIVAL2016'
ans = 0
for i in range(len(S)):
  if S[i] == T[i]:
    ans += 1
print(ans)

Fixed, accepted submission:
S = input()
T = 'CODEFESTIVAL2016'
ans = 0
for i in range(len(S)):
  if S[i] != T[i]:
    ans += 1
print(ans)
Problem:
You are given two integers A and B as the input. Output the value of A + B.  However, if A + B is 10 or greater, output `error` instead.

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

if a + b < 10:
  print('Yes')
else:
  print('error')

Fixed, accepted submission:
a,b = map(int, input().split())

if a + b < 10:
  print(a + b)
else:
  print('error')
Problem:
We have N cards. A number a_i is written on the i-th card.   Alice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.   The game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
a_list = list(map(int, input().split()))
print(a_list)

a_list.sort(reverse = True)
alice_sum = 0
bob_sum = 0
for i in range(len(a_list)):
    if i % 2 == 0:
        alice_sum += a_list[i]
    else:
        bob_sum += a_list[i]

print(alice_sum - bob_sum)

Fixed, accepted submission:
n = int(input())
a_list = list(map(int, input().split()))

a_list.sort(reverse = True)
alice_sum = 0
bob_sum = 0
for i in range(len(a_list)):
    if i % 2 == 0:
        alice_sum += a_list[i]
    else:
        bob_sum += a_list[i]

print(alice_sum - bob_sum)
Problem:
To become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives.  He is famous across the country for his ability to foresee the future. He already knows that the price of one stock in the next N days will be as follows:    * A_1 yen on the 1-st day, A_2 yen on the 2-nd day, ..., A_N yen on the N-th day.  In the i-th day, M-kun can make the following trade **any number of times** (possibly zero), **within the amount of money and stocks that he has at the time**.    * Buy stock: Pay A_i yen and receive one stock.   * Sell stock: Sell one stock for A_i yen.  What is the maximum possible amount of money that M-kun can have in the end by trading optimally?

Incorrect submission (verdict: Wrong Answer):
input()
A=list(map(int,input().split()))
M=[0,1000]
for i in range(0,len(A)-1):
    if A[i]>A[i+1]:
        M[1]+=A[i]*M[0]
        M[0]=0
    elif A[i]<A[i+1]:
        M[0]+=int(M[1]/A[i])
        M[1]=M[1]%A[i]
M[1]+=A[i+1]*M[0]
M[0]=0
print(M)

Fixed, accepted submission:
input()
A=list(map(int,input().split()))
M=[0,1000]
for i in range(0,len(A)-1):
    if A[i]>A[i+1]:
        M[1]+=A[i]*M[0]
        M[0]=0
    elif A[i]<A[i+1]:
        M[0]+=int(M[1]/A[i])
        M[1]=M[1]%A[i]
M[1]+=A[i+1]*M[0]
M[0]=0
print(M[1])
Problem:
You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in total?  Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.

Incorrect submission (verdict: Wrong Answer):
a,b,c,x=map(int,[input() for i in range(4)])
ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*500+j+100+k*50==x:
                ans+=1
print(ans)

Fixed, accepted submission:
a,b,c,x=map(int,[input() for i in range(4)])
ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*500+j*100+k*50==x:
                ans+=1
print(ans)
Problem:
An elementary school student Takahashi has come to a variety store.  He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?  Note that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.

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

D = A + B

if( D <= C):
  print('Yes')
  
else:
  print('No')

Fixed, accepted submission:
A, B, C = map( int, input().split())

D = A + B

if( C <= D):
  print('Yes')
  
else:
  print('No')
Problem:
You have an integer variable x. Initially, x=0.  Some person gave you a string S of length N, and using the string you performed the following operation N times. In the i-th operation, you incremented the value of x by 1 if S_i=`I`, and decremented the value of x by 1 if S_i=`D`.  Find the maximum value taken by x during the operations (including before the first operation, and after the last operation).

Incorrect submission (verdict: Wrong Answer):
s = input()

x = 0
mx = 0
for c in s:
    if c == 'I':
        x += 1
    if c == 'D':
        x -= 1
    if x > mx:
        mx = x
print(max(x, mx))

Fixed, accepted submission:
n = input()
s = input()

x = 0
mx = 0
for c in s:
    if c == 'I':
        x += 1
    if c == 'D':
        x -= 1
    mx = max(x, mx)
print(max(x, mx))
Problem:
There is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white.  Snuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) point was (x_i, y_i).  Then, he created an integer sequence a of length N, and for each 1 ≦ i ≦ N, he painted some region within the rectangle black, as follows:    * If a_i = 1, he painted the region satisfying x < x_i within the rectangle.   * If a_i = 2, he painted the region satisfying x > x_i within the rectangle.   * If a_i = 3, he painted the region satisfying y < y_i within the rectangle.   * If a_i = 4, he painted the region satisfying y > y_i within the rectangle.  Find the area of the white region within the rectangle after he finished painting.

Incorrect submission (verdict: Wrong Answer):
W,H,N = map(int,input().split())
Data = []
for _ in range(N):
    Data.append(list(map(int,input().split())))

x1,x2 = 0,W
y1,y2 = 0,H

for i in range(N):
    x,y,a = Data[i]
    if a == 1:
        x1 = max(x1,x)
    elif a == 2:
        x2 = min(x2,x)
    elif a == 3:
        y1 = max(y1,y)
    elif a == 4:
        y2 = min(y2,y)
    print(x1,x2,y1,y2)

if x2 >= x1 and y2 >= y1:
    s = (x2-x1)*(y2-y1)
else:
    s = 0
print(s)

Fixed, accepted submission:
W,H,N = map(int,input().split())
Data = []
for _ in range(N):
    Data.append(list(map(int,input().split())))

x1,x2 = 0,W
y1,y2 = 0,H

for i in range(N):
    x,y,a = Data[i]
    if a == 1:
        x1 = max(x1,x)
    elif a == 2:
        x2 = min(x2,x)
    elif a == 3:
        y1 = max(y1,y)
    elif a == 4:
        y2 = min(y2,y)

if x2 >= x1 and y2 >= y1:
    s = (x2-x1)*(y2-y1)
else:
    s = 0
print(s)
Problem:
Matsuzaki 教授は，宇宙の真理を研究している科学者である．人生，宇宙，すべての答えは 42 であると言われているが，Matsuzaki 教授はこれだけでは宇宙の真理を解明するには不十分であると考えている．Matsuzaki 教授は，宇宙の真理は 2 つのパラメータからなる関数で表されると考えており，42 はその 1 つに過ぎないというのである．  Matsuzaki 教授の定義した関数 M( _N_ , _P_ ) は， _N_ より大きい素数を 2 つ選んで（同じ数を 2 つでも構わない）和をとることで得られる数の全体を，小さいほうから順番に並べたときに， _P_ 番目に現れる数を表す．ここで，2 通り以上の和で表されるような数も存在するが，そういった数は和の組み合わせの数と同じ個数だけ並べられる．  例として _N_ = 0 の場合を考えよう．このときは素数全体から 2 つを選んで和をとることになる．そういった和のうちで最小の数を考えると，同じ数を 2 回選ぶことも許されていることから，2 + 2 = 4 であることがわかる．すなわち M(0, 1) = 4 である．次に小さい数は 2 + 3 = 5 であるから M(0, 2) = 5 となる．同様にして考えると，和を並べたものは 4, 5, 6, 7, 8, 9, 10, 10, 12, 13, 14, 14, 16, ... のようになることがわかる．すなわち，たとえば M(0, 9) = 12 である．  同じようにして _N_ = 10 の場合を考えると，このときは 10 より大きい素数 {11, 13, 17, 19, ...} から 2 つを選ぶことになり，得られる和を小さいほうから並べると 22, 24, 26, 28, 30, 30, 32, ... のようになる．  あなたの仕事は， _N_ と _P_ が与えられた時に M( _N_ , _P_ ) を計算するプログラムを書くことである．

Incorrect submission (verdict: Wrong Answer):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math
import itertools

def sieve_of_erastosthenes(num):
    input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False
    input_list[2] = input_list[3] = input_list[5] = True
    sqrt = math.sqrt(num)

    for serial in range(3, num, 2):
        if serial >= sqrt:
            return input_list
        for s in range(serial ** 2, num, serial): 
            input_list[s] = False

primeTable = sieve_of_erastosthenes(10**6)

while True:
    N,P = map(int,input().split(" "))
    if N == -1 and P == -1:
        break
    start = N
    while primeTable[start] is False:
        start += 1
    prime_list = []
    count = 0
    i = 0
    while count != P:
        if primeTable[start + i]:
            prime_list.append(start+i)
            count += 1
        i += 1
    print(sorted([sum(t) for t in itertools.combinations_with_replacement(prime_list,2)])[P-1])

Fixed, accepted submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math
import itertools

def sieve_of_erastosthenes(num):
    input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False
    input_list[2] = input_list[3] = input_list[5] = True
    sqrt = math.sqrt(num)

    for serial in range(3, num, 2):
        if serial >= sqrt:
            return input_list
        for s in range(serial ** 2, num, serial): 
            input_list[s] = False

primeTable = sieve_of_erastosthenes(10**6)

while True:
    N,P = map(int,input().split(" "))
    if N == -1 and P == -1:
        break
    start = N+1
    while primeTable[start] is False:
        start += 1
    prime_list = []
    count = 0
    i = 0
    while count != P:
        if primeTable[start + i]:
            prime_list.append(start+i)
            count += 1
        i += 1
    print(sorted([sum(t) for t in itertools.combinations_with_replacement(prime_list,2)])[P-1])
Problem:
You are given an integer N. Build an undirected graph with N vertices with indices 1 to N that satisfies the following two conditions:    * The graph is simple and connected.   * There exists an integer S such that, for every vertex, the sum of the indices of the vertices adjacent to that vertex is S.  It can be proved that at least one such graph exists under the constraints of this problem.

Incorrect submission (verdict: Wrong Answer):
n = input().strip()
n = int(n)
r = set()
if n % 2 == 0:
    x = n + 1
    for i in range(n):
        i = i + 1
        for j in range(n):
            j = j + 1
            if j <= i:
                continue
            if i + j == x:
                continue
            print(i,j)
else:
    m = n - 1
    x = n
    for i in range(m):
        i = i + 1
        for j in range(m):
            j = j + 1
            if j <= i:
                continue
            if i + j == x:
                continue
            print(i,j)
    for i in range(m):
        print(i+1, x)


Fixed, accepted submission:
n = input().strip()
n = int(n)
r = list()
if n % 2 == 0:
    x = n + 1
    for i in range(n):
        i = i + 1
        for j in range(n):
            j = j + 1
            if j <= i:
                continue
            if i + j == x:
                continue
            r.append((i,j))
else:
    m = n - 1
    x = n
    for i in range(m):
        i = i + 1
        for j in range(m):
            j = j + 1
            if j <= i:
                continue
            if i + j == x:
                continue
            r.append((i, j))
    for i in range(m):
        r.append((i+1, x))
print(len(r))
for l in r:
    print(l[0], l[1])
Problem:
We have a board with H horizontal rows and W vertical columns of squares. There is a bishop at the top-left square on this board. How many squares can this bishop reach by zero or more movements?  Here the bishop can only move diagonally. More formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:    * r_1 + c_1 = r_2 + c_2   * r_1 - c_1 = r_2 - c_2  For example, in the following figure, the bishop can move to any of the red squares in one move:  

Incorrect submission (verdict: Wrong Answer):
h,w=map(int,input().split())
if (h*w)%2==0:
    print((h*w)/2)
else:
    print((h*w+1)/2)

Fixed, accepted submission:
h,w=map(int,input().split())
if h==1 or w==1:
    print(1)
else:
    if (h*w)%2==0:
        print((h*w)//2)
    else:
        print((h*w+1)//2)
Problem:
You went shopping to buy cakes and donuts with X yen (the currency of Japan).  First, you bought one cake for A yen at a cake shop. Then, you bought as many donuts as possible for B yen each, at a donut shop.  How much do you have left after shopping?

Incorrect submission (verdict: Wrong Answer):
a = int(input())
b = int(input())
c = int(input())
print((a-b)//c)

Fixed, accepted submission:
a,b,c = int(input()), int(input()), int(input())
print((a-b)%c)
Problem:
An _X -layered kagami mochi_ (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.  Lunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?

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

lst = list(map(int, [input() for i in range(n)]))

set(lst)

print(len(lst))

Fixed, accepted submission:
n = int(input())

lst = map(int, [input() for i in range(n)])

print(len(set(lst)))
Problem:
There are N empty boxes arranged in a row from left to right. The integer i is written on the i-th box from the left (1 \leq i \leq N).  For each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.  We say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:    * For every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.  Does there exist a good set of choices? If the answer is yes, find one good set of choices.

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

i=n-1
while i>=0:
    if A[i]==1:
        s=i
        break
    i-=1

if i==-1:
    print(0)
elif s==0:
    print(1)
else:
    i=int((s+1)**0.5)
    while i>=0:
        B=[A[j] for j in range(i+1,n,i+1)]
        r=sum(B[1:])
        if r%2==0:
            A[i]=1
        else:
            A[i]=0
        i-=1
    C=[m for m,k in enumerate(A,1) if k!=0]
    print(len(C))
    print(*C)

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

i=n-1
while i>=0:
    if A[i]==1:
        s=i
        break
    i-=1

if i==-1:
    print(0)
elif s==0:
    print(1)
    print(1)
else:
    i=(s+1)//2-1
    while i>=0:
        B=[A[j] for j in range(i,n,i+1)]
        r=sum(B[1:])
        if r%2==0 and A[i]==0:
            A[i]=0
        elif r%2==0 and A[i]==1:
            A[i]=1
        elif r%2==1 and A[i]==0:
            A[i]=1
        else:
            A[i]=0
        i-=1
    C=[m for m,k in enumerate(A,1) if k!=0]
    print(len(C))
    print(*C)
Problem:
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.  According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.

Incorrect submission (verdict: Wrong Answer):
[n, y] = list(map(int, input().split()))

ans = []
for a in range(n+1):
    for b in range(n+1):
        c = n-a-b
        if c < 0:
            continue
        if (a*10000 + b*5000 + c*1000) == y:
            ans.append([a, b, c])
print(ans[0]) if len(ans) else print('-1 -1 -1')

Fixed, accepted submission:
n, y = map(int, input().split())

ans = [-1, -1, -1]

for a in range(n+1):
    for b in range(n-a+1):
        if (a*10000 + b*5000 + (n-a-b)*1000) == y:
            ans = [a, b, n-a-b]
print(*ans)
Problem:
Snuke is buying a bicycle. The bicycle of his choice does not come with a bell, so he has to buy one separately.  He has very high awareness of safety, and decides to buy two bells, one for each hand.  The store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively. Find the minimum total price of two different bells.

Incorrect submission (verdict: Wrong Answer):
s=list(map(int,input().split()))
print(sum(sorted(s)[::2]))


Fixed, accepted submission:
s=list(map(int,input().split()))
print(sum(sorted(s)[:2]))
Problem:
There are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?

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

s=input()
checked=[]
for i in range(len(s)):
    suffix=s[i:]
    f_len=len(suffix)
    for j in range(f_len):
        if(j==0):
            fact=suffix
        elif(j>0):
            fact=fact[:-1]
        if(fact in checked):
            continue
        count=Counter(fact)
        count_max=max(count.values())
        moji=[moji for moji,j in count.items() if j==count_max]
        moji=moji[0]
        if(count[moji]>len(fact)/2 and len(fact)>1):
            span=(re.search(fact,s).span())
            print(span[0]+1,span[1])
            sys.exit()
        checked.append(fact)
print(-1,-1)

Fixed, accepted submission:
n=int(input())
print(int((n*(1+n)/2)))
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):
  w=input()
  if w=="AC":
    a=a+1
  elif w=="TLE":
    b=b+1
  elif w=="WA":
    c=c+1
  else:
    d=d+1
print("AC "+"x "+str(a))
print("WA "+"x "+str(c))
print("TLE "+"x "+str(b))
print("TL "+"x "+str(d))



Fixed, accepted submission:
n=int(input())
a=0
b=0
c=0
d=0
for i in range(n):
  w=input()
  if w=="AC":
    a=a+1
  elif w=="TLE":
    b=b+1
  elif w=="WA":
    c=c+1
  else:
    d=d+1
print("AC "+"x "+str(a))
print("WA "+"x "+str(c))
print("TLE "+"x "+str(b))
print("RE "+"x "+str(d))
Problem:
You are given a string S consisting of `0` and `1`. Find the maximum integer K not greater than |S| such that we can turn all the characters of S into `0` by repeating the following operation some number of times.    * Choose a contiguous segment [l,r] in S whose length is at least K (that is, r-l+1\geq K must be satisfied). For each integer i such that l\leq i\leq r, do the following: if S_i is `0`, replace it with `1`; if S_i is `1`, replace it with `0`.

Incorrect submission (verdict: Wrong Answer):
s = input()
#s = '00001111'
k = 0
l = 1
for i in range(1, len(s)):
    print(s[i-1:i+1])
    if s[i-1:i+1] == '01' or s[i-1:i+1] == '10':
        k = max(k, l)
        l = 1
    else:
        l += 1
print(max(k, l))




Fixed, accepted submission:
s = input()
"""
s = '101'
s = '100000000'
s = '00001011'
"""
k = len(s)
for i in range(1, len(s)):
    if s[i-1] != s[i]:
        k = min(k, max(i, len(s)-i))
print(k)
Problem:
We have an N \times N square grid.  We will paint each square in the grid either black or white.  If we paint exactly A squares white, how many squares will be painted black?

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a=int(input())
print(n^2-a)

Fixed, accepted submission:
n=int(input())
a=int(input())
print(int(n**2-a))
Problem:
Based on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below. Given two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group.  

Incorrect submission (verdict: Wrong Answer):
# A - Grouping
a=['1','3','5','7','8','10','12']
b=['4','6','9','11']
x,y=list(map(int,input().split()))
if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
else:
    print("No")



Fixed, accepted submission:
# A - Grouping
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
x,y=list(map(int,input().split()))
if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
else:
    print("No")
Problem:
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive.  Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him.

Incorrect submission (verdict: Wrong Answer):
# coding: UTF8

#input = "30 30 30"
#l = map(int, input.split())
l = list(map(int, input().split()))
l.sort()
a = l[0]
b = l[1]
c = l[2]

if a == b == c:
	print("3")
elif a == b or b == c:
	print("2")
else:
	print("1")

Fixed, accepted submission:
# coding: UTF8

#input = "30 30 30"
#l = map(int, input.split())
l = list(map(int, input().split()))
l.sort()
a = l[0]
b = l[1]
c = l[2]

if a == b == c:
	print("1")
elif a == b or b == c:
	print("2")
else:
	print("3")