TnT/CodeNet4Repair huggingface dataset:
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):
sorce_point = list(map(int, input().split()))
W = sorce_point[0]
H = sorce_point[1]
N = sorce_point[2]

point = []
for i in range(N):
	point.append(list(map(int, input().split())))
point.append(sorce_point)
for i in range(N + 1):
	if (point[i][2] == 1):
		for j in range(N):
			if point[j][0] < point[i][0]:
				point[j][0] = 0
				point[j][1] = 0
	if (point[i][2] == 2):
		for j in range(N + 1):
			if point[j][0] > point[i][0]:
				point[j][0] = 0
				point[j][1] = 0
	if (point[i][2] == 3):
		for j in range(N + 1):
			if point[j][1] < point[i][1]:
				point[j][1] = 0
	if (point[i][2] == 4):
		for j in range(N + 1):
			if point[j][1] > point[i][1]:
				point[j][1] = 0

point.append(sorce_point)
print(point)
mx= 0
my = 0
mix = 100
miy = 100
for i in range(N + 1):
	if mx < point[i][0]:
		mx = point[i][0]
	if my < point[i][1]:
		my = point[i][1]
	if mix > point[i][0] and not(point[i][0] == 0):
		mix = point[i][0]
	if miy > point[i][1] and not(point[i][1] == 0):
		miy = point[i][1]

print((mx - mix) * (my - miy))


Fixed, accepted submission:
W, H, N = map(int, input().split())
w, h = 0, 0

for i in range(N):
	x, y, a = map(int, input().split())

	if a == 1 and w < x:
		w = x
	elif a == 2 and W > x:
		W = x
	elif a == 3 and h < y:
		h = y
	elif a == 4 and H > y:
		H = y

if W - w <= 0 or H - h <= 0:
	print(0)
else:
	print((W - w) * (H - h))
Problem:
Takahashi is a user of a site that hosts programming contests.   When a user competes in a contest, the _rating_ of the user (not necessarily an integer) changes according to the _performance_ of the user, as follows:    * Let the current rating of the user be a.   * Suppose that the performance of the user in the contest is b.   * Then, the new rating of the user will be the avarage of a and b.  For example, if a user with rating 1 competes in a contest and gives performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.  Takahashi's current rating is R, and he wants his rating to be exactly G after the next contest.   Find the performance required to achieve it.

Incorrect submission (verdict: Wrong Answer):
R = int(input())
G = int(input())
ans = 2*G - R


Fixed, accepted submission:
R = int(input())
G = int(input())
ans = 2*G - R
print(ans)
Problem:
You are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:    * Wield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.   * Throw one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.  The monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?

Incorrect submission (verdict: Wrong Answer):
n, h = map(int, input().split())
AB = [(list(map(int, input().split()))) for _ in range(n)]

A = []
B = []
for a, b in AB:
    A.append(a)
    B.append(b)

sum_B = sum(B)
ans = len(B)
if sum_B >= h:
    print(ans)
else:
    max_A = max(A)
    h -= sum_B
    ans += h // max_A
    print(ans)

Fixed, accepted submission:
n, h = map(int, input().split())
AB = [(list(map(int, input().split()))) for _ in range(n)]

A = []
B = []
for a, b in AB:
    A.append(a)
    B.append(b)

max_A = max(A)
C = sorted([b for b in B if b >= max_A], reverse=True)

cnt = 0
for c in C:
    h -= c
    cnt += 1
    if h <= 0:
        print(cnt)
        exit()

atack = h // max_A
cnt += atack
h -= atack * max_A
if h <= 0:
    print(cnt)
else:
    print(cnt+1)
Problem:
We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime.  You are given Q queries.  In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.

Incorrect submission (verdict: Wrong Answer):
q = int(input())
like2017 = []

def is_prime(x):
    if x==2:
        return True
    elif x%2==0:
        return False

    for i in range(3, x, 2):
        if x!=i and x%i==0:
            return False
    return True

for i in range(3, 9974, 2):
    if is_prime(i) and is_prime(int((i+1)/2)):
        like2017.append(i)
# print(like2017)
for i in range(q):
    l, r = map(int, input().split())
    left = 0
    right = 0
    for j in like2017:
        if l==1:
            left = 0
        if j < l:
            left = like2017.index(j)
        elif j > r:
            right = like2017.index(j)-1
            break
    print(right-left)


Fixed, accepted submission:
import numpy as np

q = int(input())


is_prime = np.ones(100001, dtype=int)
is_prime[0]=0
is_prime[1]=0

for i in range(2,100001):
    if is_prime[i]==1:
        j=i+i
        while j <= 100000:
            is_prime[j] = 0
            j += i

like2017 = [1 if is_prime[i] and is_prime[(i+1)//2] else 0 for i in range(0,100001) ]

for i in range(1,100001):
    like2017[i] += like2017[i-1]
for i in range(q):
    l,r = map(int, input().split())
    print(like2017[r]-like2017[l-1])
Problem:
You are given a string s consisting of lowercase English letters. Extract all the characters in the odd-indexed positions and print the string obtained by concatenating them. Here, the leftmost character is assigned the index 1.

Incorrect submission (verdict: Wrong Answer):
A = list(input())
N = len(A)
Ans = [A[0]]
for i in range(2, N-1, 2):
    Ans.append(A[i])
print("".join(Ans))

Fixed, accepted submission:
A = list(input())
N = len(A)
Ans = []
for i in range(0, N, 2):
    Ans.append(A[i])
print("".join(Ans))
Problem:
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.    An example of a trapezoid  Find the area of this trapezoid.

Incorrect submission (verdict: Wrong Answer):
a=int(input())
b=int(input())
h=int(input())
print(h*(a+b)/2)

Fixed, accepted submission:
a=int(input())
b=int(input())
h=int(input())
print(int(h*(a+b)/2))
Problem:
We have a grid of H rows and W columns of squares. The color of the square at the i-th row from the top and the j-th column from the left (1 \leq i \leq H, 1 \leq j \leq W) is given to you as a character c_{i,j}: the square is white if c_{i,j} is `.`, and black if c_{i,j} is `#`.  Consider doing the following operation:    * Choose some number of rows (possibly zero), and some number of columns (possibly zero). Then, paint red all squares in the chosen rows and all squares in the chosen columns.  You are given a positive integer K. How many choices of rows and columns result in exactly K black squares remaining after the operation? Here, we consider two choices different when there is a row or column chosen in only one of those choices.

Incorrect submission (verdict: Wrong Answer):
import copy
H, W, K = list(map(int, input().split()))
matrix = [[0 for j in range(W)] for i in range(H)]
for i in range(H):
    c_i = input()
    for j in range(W):
        if c_i[j] == '#':
            matrix[i][j] = 1
p = copy.deepcopy(matrix)
COUNT = 0
for i in range(2**(H+W)):
    x_i = []
    y_i = []
    count = 0
    for j in range(H+W):
        if ((i >> j) & 1):
            if j < H:
                x_i.append(j)
            else:
                y_i.append(j-H)
    for k in x_i:
        for l in range(W):
            matrix[k][l] = -1
    for k in range(H):
        for l in y_i:
            
            matrix[k][l] = -1
    for k in range(H):
        for l in range(W):
            if matrix[k][l] == 1:
                count += 1
    if count == K:
        COUNT += 1
    matrix = p
print(COUNT)       

Fixed, accepted submission:
import copy
H, W, K = list(map(int, input().split()))
matrix = [[0 for j in range(W)] for i in range(H)]
matrix2 = [[0 for j in range(W)] for i in range(H)]
for i in range(H):
    c_i = input()
    for j in range(W):
        if c_i[j] == '#':
            matrix[i][j] = 1
            matrix2[i][j] = 1
COUNT = 0
for i in range(2**(H+W)):
    x_i = []
    y_i = []
    count = 0
    for j in range(H+W):
        if ((i >> j) & 1):
            if j < H:
                x_i.append(j)
            else:
                y_i.append(j-H)
    for k in x_i:
        for l in range(W):
            matrix[k][l] = -1
    for k in range(H):
        for l in y_i:
            matrix[k][l] = -1
    for k in range(H):
        for l in range(W):
            if matrix[k][l] == 1:
                count += 1
    if count == K:
        COUNT += 1
    matrix = copy.deepcopy(matrix2)
print(COUNT)
Problem:
Write a program which judges wheather given length of three side form a right triangle. Print "YES" if the given sides (integers) form a right triangle, "NO" if not so.

Incorrect submission (verdict: Wrong Answer):
import sys

n = int(input())
for i in range(n):
    line = sys.stdin.readline()
    lengths = list(map(int, line.strip().split()))
    if lengths[0] == lengths[1] == lengths[2]:
        print('YES')
    else:
        print('NO')

Fixed, accepted submission:
import sys

n = int(sys.stdin.readline().strip())
for i in range(n):
    line = sys.stdin.readline()
    lengths = sorted(list(map(int, line.strip().split())))
    if lengths[0]**2 + lengths[1]**2 == lengths[2]**2:
        print('YES')
    else:
        print('NO')
Problem:
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis.  You planned a trip along the axis. In this plan, you first depart from the point with coordinate 0, then visit the N spots in the order they are numbered, and finally return to the point with coordinate 0.  However, something came up just before the trip, and you no longer have enough time to visit all the N spots, so you decided to choose some i and cancel the visit to Spot i. You will visit the remaining spots as planned in the order they are numbered. You will also depart from and return to the point with coordinate 0 at the beginning and the end, as planned.  For each i = 1, 2, ..., N, find the total cost of travel during the trip when the visit to Spot i is canceled.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a=list(map(int, input().split()))
a.append(0)
a=[0]+a
ans=0

for i in range(n+1):
    ans+=abs(a[i+1]-a[i])

for i in range(1,n+1):
    if a[i]>=0:
        if a[i]<=a[i+1]:
            print(ans)
        else:
            print(ans-(2*abs(a[i]-a[i-1])))
    else:
        if a[i]>=a[i+1]:
            print(ans)
        else:
            print(ans-(2*abs(a[i]-a[i-1])))

Fixed, accepted submission:
n=int(input())
a=list(map(int, input().split()))
a.append(0)
a=[0]+a
ans=0

for i in range(n+1):
    ans+=abs(a[i+1]-a[i])

for i in range(1,n+1):
    x=abs(a[i+1]-a[i-1])
    y=abs(a[i+1]-a[i])+abs(a[i]-a[i-1])
    print(ans+x-y)
Problem:
Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).

Incorrect submission (verdict: Wrong Answer):
input_line = input()
x, y, z = map(str, input_line.split())

print(x, y, z)
resultNum = 0

for i in range(int(x)):
  loopCnt = len(str(i))
  addNum = 0
  for j in range(loopCnt):
    addNum += int(str(i)[j])
  if int(y) <= addNum <= int(z):
    resultNum += i

print(resultNum)

Fixed, accepted submission:
input_line = input()
x, y, z = map(str, input_line.split())

resultNum = 0

for i in range(int(x)+1):
  loopCnt = len(str(i))
  addNum = 0
  for j in range(loopCnt):
    addNum += int(str(i)[j])
  if int(y) <= addNum <= int(z):
    resultNum += i

print(resultNum)
Problem:
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.

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

cnt = 0
for a in range(K, N+1):
    for b in range(K, a+1):
        if a == 0 or b == 0:
            continue
        if ((a%b) >= K):
            print(a,b)
            cnt += 1
            print(cnt)

print(cnt)

cnt += 0.5*(N**2 - 2*N*K - N + K**2 + K)
print(int(cnt))


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

cnt = 0
for b in range(1, N+1):
    p = N // b
    q = N % b
    cnt += max(b-K,0)*p + max(q+1-K,0)
if K == 0:
    cnt -= N
print(int(cnt))
Problem:
How many multiples of d are there among the integers between L and R (inclusive)?

Incorrect submission (verdict: Wrong Answer):
l, r, d = map(int, input().split())

cnt = 0
tmp = d
while tmp <= r:
    if tmp <= r and tmp >= l:
        cnt += 1
    tmp += d
print(5)

Fixed, accepted submission:
l, r, d = map(int, input().split())

cnt = 0
tmp = d
while tmp <= r:
    if tmp <= r and tmp >= l:
        cnt += 1
    tmp += d
print(cnt)
Problem:
On some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in `yyyy/mm/dd` format. For example, January 23, 2018 should be written as `2018/01/23`.  After finishing the document, she noticed that she had mistakenly wrote `2017` at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to `2018` and prints it.

Incorrect submission (verdict: Wrong Answer):
S=input()
S[3].replace('7','8')
print(S)

Fixed, accepted submission:
print('2018/01/'+input()[8:])
Problem:
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.

Incorrect submission (verdict: Wrong Answer):
a = input()
a.swapcase()
print(a)

Fixed, accepted submission:
print(input().swapcase())
Problem:
Write a program which reads three integers a, b and c, and prints "Yes" if a < b < c, otherwise "No".

Incorrect submission (verdict: Wrong Answer):
# (c) midandfeed
q = [int(x) for x in input().split()]

print("YES" if ( q == sorted(q) ) else "NO")

Fixed, accepted submission:
# (c) midandfeed
q = [int(x) for x in input().split()]
ans = True
for i in range(1, len(q)):
	ans = ans and (q[i-1] < q[i])
	
print("Yes" if ans else "No")
Problem:
AtCoDeer has three cards, one red, one green and one blue.   An integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card.   We will arrange the cards in the order red, green and blue from left to right, and read them as a three-digit integer.   Is this integer a multiple of 4?

Incorrect submission (verdict: Wrong Answer):
print("Yes" if int("".join(input().split()))%4==0 else "No")

Fixed, accepted submission:
print("YES" if int("".join(input().split()))%4==0 else "NO")
Problem:
    図のように二股に分かれている容器があります。1 から 10 までの番号が付けられた10 個の玉を容器の開口部 A から落とし、左の筒 B か右の筒 C に玉を入れます。板 D は支点 E を中心に左右に回転できるので、板 D を動かすことで筒 B と筒 C のどちらに入れるか決めることができます。  開口部 A から落とす玉の並びを与えます。それらを順番に筒 B 又は筒 Cに入れていきます。このとき、筒 B と筒 C のおのおのが両方とも番号の小さい玉の上に大きい玉を並べられる場合は YES、並べられない場合は NO と出力するプログラムを作成してください。ただし、容器の中で玉の順序を入れ替えることはできないものとします。また、続けて同じ筒に入れることができるものとし、筒 B, C ともに 10 個の玉がすべて入るだけの余裕があるものとします。

Incorrect submission (verdict: Wrong Answer):
def main():
    n = int(input())
    for i in range(n):
        Ball = map(int,input().split())
        l = r = 0
        for value in Ball:
            if value > r:
                r = value
            elif value > l:
                l = value
            else:
                print("NO")
                r = -777
                break
            
        if r == -777:
            continue
        else:
            print("Yes")

if __name__ == '__main__':
    main()



Fixed, accepted submission:
def main():
    n = int(input())
    for i in range(n):
        Ball = map(int,input().split())
        l = r = 0
        for value in Ball:
            if value > r:
                r = value
            elif value > l:
                l = value
            else:
                print("NO")
                r = -777
                break
            if r < l:
                r,l = l,r
            
        if r == -777:
            continue
        else:
            print("YES")

if __name__ == '__main__':
    main()
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 = input()

s = s[:-1]
if len(s) % 2 != 0:
    s = s[:-1]


while(True):
    s1, s2 = s[0:len(s)//2], s[len(s)//2:len(s)]
    print(s1, s2)
    if s1 == s2:
        print(len(s1))
        break

    s = s[:-2]

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

if a <= c and b <= c:
    print(a + b)
elif a <= b and c <= b:
    print(a + c)
elif b <= a and c <= a:
    print(b + c)
Problem:
Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.  The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)  Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?

Incorrect submission (verdict: Wrong Answer):
import math
x = int(input())
count=0
count_1 = 100
ans=0

while x >= count_1:
    count=(math.floor(count_1*0.01))
    count_1+=math.floor(count)
    ans += 1
print(ans)

Fixed, accepted submission:
import math
x = int(input())
count=0
count_1 = 100
ans=0

while x > count_1:
    count=(math.floor(count_1*0.01))
    count_1+=math.floor(count)
    ans += 1
print(ans)
Problem:
There are three positive integers A, B and C written on a blackboard. E869120 performs the following operation K times:    * Choose one integer written on the blackboard and let the chosen integer be n. Replace the chosen integer with 2n.  What is the largest possible sum of the integers written on the blackboard after K operations?

Incorrect submission (verdict: Wrong Answer):
a=list(map(int,input().split()))
a.sort()
k=int(input())
print(a[0]+a[1]+a[2]*k)

Fixed, accepted submission:
a=list(map(int,input().split()))
a.sort()
k=int(input())
print(a[0]+a[1]+a[2]*(2**k))
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 =list(map(int,input().split()))
i =0
cnt = 0
while "loop":
    if N[i] % 2 !=  0 :
        break
    else:
        N[i]= N[i] / 2
        i+=1
        cnt+=1
        if i==len(N) :
            i=0
print(cnt)


Fixed, accepted submission:
import math
n = input()
a = list(map(int, input().split()))
b  = 0
cnt = 0
while "loop":
    for num in a:
        if num % 2 == 1:
            b= 1
    if  b == 0:
            a = [ i	/2 for i in a]
            cnt += 1
    else:
        break
print(cnt)
Problem:
Taro is going to play a card game. However, now he has only n cards, even though there should be 52 cards (he has no Jokers).  The 52 cards include 13 ranks of each of the four suits: spade, heart, club and diamond.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
cards = []
for _ in range(n):
    suit, num = input().split()
    num = int(num)
    cards.append((suit, num))

for suit in ('S', 'H', 'C', 'D'):
    for num in range(13):
        if (suit, num + 1) in cards:
            print(suit, '', num)


Fixed, accepted submission:
n = int(input())
cards = []
for _ in range(n):
    suit, num = input().split()
    num = int(num)
    cards.append((suit, num))

for suit in ('S', 'H', 'C', 'D'):
    for num in range(13):
        if not((suit, num + 1) in cards):
            print(suit, num + 1)
Problem:
E869120 has A 1-yen coins and infinitely many 500-yen coins.   Determine if he can pay exactly N yen using only these coins.

Incorrect submission (verdict: Wrong Answer):
N,A = map(int,open(0).read().split())
if 500+A >= N:
    print("Yes")
else:
    print("No")
    

Fixed, accepted submission:
N,A = map(int,open(0).read().split())
if N%500 <= A:
    print("Yes")
else:
    print("No")
Problem:
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.    An example of a trapezoid  Find the area of this trapezoid.

Incorrect submission (verdict: Wrong Answer):
print("abh")


Fixed, accepted submission:
a=int(input())
b=int(input())
h=int(input())

print(((a+b)*h)//2)
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: Time Limit Exceeded):
a, b = map(int, input().split())

prime = [2]
for i in range(3, 10**5):
  flag = True
  for j in prime:
    if i % j == 0:
      flag = False
      break
  if flag:
    prime.append(i)

a_dict = dict()
b_dict = dict()

for i in prime:
  if a < i and b < i:
    break
  while a % i == 0:
    a /= i
    a_dict[i] = a_dict.get(i, 0) + 1
  while b % i == 0:
    b /= i
    b_dict[i] = b_dict.get(i, 0) + 1

ab = 1
for i in prime:
  ad = a_dict.get(i, 0)
  bd = b_dict.get(i, 0)
  n = ad if ad > bd else bd
  ab = ab * (i**n)
  
print(ab)

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

prime = [2]
for i in range(3, 10**5, 2):
  flag = True
  for j in prime:
    if j > math.sqrt(i):
      break
    if i % j == 0:
      flag = False
      break
  if flag:
    prime.append(i)

a_dict = dict()
b_dict = dict()
used = set()

for i in prime:
  if a < i and b < i:
    break
  while a % i == 0:
    a /= i
    a_dict[i] = a_dict.get(i, 0) + 1
    used.add(i)
  while b % i == 0:
    b /= i
    b_dict[i] = b_dict.get(i, 0) + 1
    used.add(i)

ab = 1
for i in used:
  ad = a_dict.get(i, 0)
  bd = b_dict.get(i, 0)
  n = ad if ad > bd else bd
  ab = ab * (i**n)
  
print(ab)
Problem:
The postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen `-`, and the other characters are digits from `0` through `9`.  You are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom.

Incorrect submission (verdict: Wrong Answer):
a,b=[int(i) for i in input().split()]
s=input()
s2=s.split()
if s[a]=='-' and s2[0].isdigit() and s2[1].isdigit():
  print("Yes")
else:
  print("No")

Fixed, accepted submission:
a,b=[int(i) for i in input().split()]
s=input()
s2=s.split("-")
if s[a]=='-' and s2[0].isdigit() and s2[1].isdigit():
  print("Yes")
else:
  print("No")