Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
a, b=map(int,input().split())

if a < b:
    a, b = b, a
while a % b != 0:
    a, b = b, a % b
# print(b)

n = b
a = []

while n % 2 == 0:
  if 2 not in a:
    a.append(2)
  n //= 2
f = 3
while n > 1:
  if n % f == 0:
    if f not in a:
      a.append(f)
    n //= f
  else:
    f += 2

N = len(a)

# print(a)
print(N+1)  


Fixed submission:
def factorization(n):
    arr = []
    Cnt = 0
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
            if i not in arr:
                Cnt += 1
                arr.append(i)

    if temp!=1 and temp not in arr:
        Cnt += 1
        arr.append(temp)

#    if arr==[]:
#        arr.append([n, 1])

    return Cnt


a, b=map(int,input().split())

if a < b:
    a, b = b, a
while a % b != 0:
    a, b = b, a % b
# print(b)
N = factorization(b)

print(N+1)
Buggy python submission (verdict: Runtime Error):
import copy

S = input()
nN = len(S)
nAns = [ 1 for i in range(nN)]
nAnsC = [ 0 for i in range(nN)]

for j in range(10**3):
  nAnsT = [ 0 for i in range(nN)]
  for i in range(nN):
    sTmp = S[i]
    
    if nAns[i]==0:
      continue
    nNum = nAns[i]
    nAns[i] = 0
    if sTmp =='R':
      nTmp = i + 1
    elif sTmp =='L':
      nTmp = i - 1
    nAnsT[nTmp] += nNum
  
  nAns = copy.deepcopy(nAnsT)
  if i==1:
    nAnsC = copy.deepcopy(nAnsT)
  else:
    nTmp2 = i
    nTmp2 &= 1
    if nTmp2 == 1:
      if nAns == nAnsC:
        break
      else:
        nAnsC = copy.deepcopy(nAns)
      
#    print(*nAns)
#  sTmp = S[nTmp]
#  if sTmp =='R':
#    nTmp += 1
#  elif sTmp =='L':
#    nTmp -= 1
  
#  nAns[nTmp] += 1
  
print(*nAns)



Fixed submission:
Tmp = []
Tmp = input().rstrip().split(' ')

nA = int(Tmp[0])
nB = int(Tmp[1])
nC = int(Tmp[2])

nAns = nC - (nA-nB)

if nAns < 0:
  nAns = 0

print(nAns)
Buggy python submission (verdict: Runtime Error):
nN = int(input())

Tmp = []
Tmp = input().rstrip().split(' ')

nData = [0 for i in range(nN)]

for i in range(nN):
  nData[i] = int (input(Tmp[i]))

nFlag = 0
nCnt = 0

for i in range(nN-1):
  if nData[i] > nData[i+1]:
    nCnt += 1

if nCnt < 2:
  print('YES')
else:
  print('NO')
  




Fixed submission:
nN = int(input())

Tmp = []
Tmp = input().rstrip().split(' ')

nData = [0 for i in range(nN)]

for i in range(nN):
  nData[i] = int(Tmp[i])

nFlag = 0
nCnt = 0

for i in range(nN):
  nTmp = i + 1
  if nData[i] != nTmp:
    nCnt += 1
    nTmp2 = nData[i] - 1
    nTmp3 = nData[nTmp2]
    if nTmp3 != nTmp:
      nCnt += 1
    else:
      nData[nTmp2]=nTmp2+1
  

  
if nCnt < 2:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
import numpy as np

Tmp = []
Tmp = input().rstrip().split(' ')

nN = int(Tmp[0])
nM = int(Tmp[1])
nC = int(Tmp[2])
nAns = 0
ListA = []
ListB = []
ListB += list(map(int,input().split()))
nAns = 0

for i in range(nN):
  ListA += list(map(int,input().split()))
  nTmp = np.dot(ListA, ListB.T)
  nTmp += nC
  if nTmp > 0:
    nAns += 1

print(nAns)



Fixed submission:
import numpy as np
 
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nM = int(Tmp[1])
nC = int(Tmp[2])
nAns = 0
ListA = [0 for i in range(nM)]
ListB = [0 for i in range(nM)]
Tmp = input().rstrip().split(' ')
for i in range(nM):
  ListB[i] = int(Tmp[i])
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
  for j in range(nM):
    ListA[j] = int(Tmp[j])

    
#  nTmp = np.dot(ListA, ListB.T)
  nTmp = 0
  for j in range(nM):
    nTmp += ListA[j] * ListB[j]
  nTmp += nC
  if nTmp > 0:
    nAns += 1

print(nAns)
Buggy python submission (verdict: Runtime Error):
Tmp = []
Tmp = input().rstrip().split(' ')

nN = int(Tmp[0])
nM = int(Tmp[1])

nF = [ 0 for i in range(nM)]

for i in range(nN):
  Tmp = input().rstrip().split(' ')
  nTmpN = int(Tmp[0])
  for j in range(nTmpN):
    nCnt = int(Tmp[j+1])
    nF[nCnt] += 1

nAns = 0
for i in range(nM):
  nTmpN = nF[i]
  if nTmpN == nN:
    nAns += 1

print(nAns)
  


Fixed submission:
Tmp = []
Tmp = input().rstrip().split(' ')

nN = int(Tmp[0])
nM = int(Tmp[1])

nData = [[ 0 for i in range(2)] for j in range(nM)]

for i in range(nM):
    nData[i][0]=i+1

for i in range(nN):
	Tmp = input().rstrip().split(' ')
	nK = int(Tmp[0])
	nTmp =[ 0 for j in range(nK)]
	for j in range(nK):
		nTmp[j] = int(Tmp[j+1])
#	print(nTmp)
	for j in range(nM):
		if nData[j][0]  in nTmp:
			nData[j][1] += 1

nAns=0
for i in range(nM):    
    if nData[i][1]==nN:
        nAns += 1

print(nAns)
Buggy python submission (verdict: Runtime Error):
N = int(input())
Flag = 0
nList = []
nList.append(N)
i = 2
while Flag==0:
  Tmp = N % 2
  if Tmp == 0:
    TmpN /= 2
  else:
    TmpN = 3 * N + 1
  
  if TmpN in nList:
    Flag = 1
    break
  else:
    nList.append(TmpN)
    N = TmpN
    i += 1

print(i)





Fixed submission:
N = int(input())
Flag = 0
nList = []
nList.append(N)
i = 2
while Flag==0:
  Tmp = N % 2
  TmpN = N
  if Tmp == 0:
    TmpN /= 2
  else:
    TmpN = 3 * N + 1
  
  if TmpN in nList:
    Flag = 1
    break
  else:
    nList.append(TmpN)
    N = TmpN
    i += 1

print(i)
Buggy python submission (verdict: Runtime Error):
nN = int(input())
nP = [ 0 for i in range(nN)]
 
for i in range(nN):
  nP[i] = int(input())

nP.sort(reverse=True)
 
nAns = 0
for i in range(nN):
  if i == 0:
    nAns += (nP[i]//2)
  else:
    nAns += nP[i]

print((%d) %(nAns))


Fixed submission:
nN = int(input())
nP = [ 0 for i in range(nN)]
 
for i in range(nN):
  nP[i] = int(input())

nP.sort(reverse=True)
 
nAns = 0
for i in range(nN):
  if i == 0:
    nAns += (nP[i]//2)
  else:
    nAns += nP[i]

print('%d' %(nAns))

Buggy python submission (verdict: Runtime Error):
nN = int(input())
nP = [ 0 for i in range(nN)]
 
for i in range(nN):
  nP[i] = int(input())
 
nP.sort(reverse=True)
 
nAns = 0
for i in range(nN):
  if i == 0:
    nAns += (nP[i]//2)
  else:
    nAns += nP[i]
 
print((%d) %(nAns))


Fixed submission:
nN = int(input())
nP = [ 0 for i in range(nN)]
 
for i in range(nN):
  nP[i] = int(input())

nP.sort(reverse=True)
 
nAns = 0
for i in range(nN):
  if i == 0:
    nAns += (nP[i]//2)
  else:
    nAns += nP[i]

print('%d' %(nAns))
Buggy python submission (verdict: Runtime Error):
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT <= nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1
 
if nAns == 0:
  print('TLE')
else:
  print(nCost)
 
#6727236

ソースコード 

Copy
Copy
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT <= nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)
 


Fixed submission:
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT <= nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)

Buggy python submission (verdict: Runtime Error):
#6727236

ソースコード 

Copy
Copy
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT <= nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)
 

Fixed submission:
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT <= nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)

Buggy python submission (verdict: Runtime Error):
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT =< nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)
 

Fixed submission:
Tmp = []
Tmp = input().rstrip().split(' ')
 
nN = int(Tmp[0])
nT = int(Tmp[1])
 
nCost = 1001
nAns = 0
 
for i in range(nN):
  Tmp = input().rstrip().split(' ')
 
  nTmpCost = int(Tmp[0])
  nTmpT = int(Tmp[1])
  
  if nTmpT <= nT and nTmpCost < nCost:
    nCost = nTmpCost
    nAns = i+1

if nAns == 0:
  print('TLE')
else:
  print(nCost)
Buggy python submission (verdict: Runtime Error):
Tmp = []
Tmp = input().rstrip().split(',')

Ans = []

nA = int(Tmp[0])
Ans.append(nA)

nB = int(Tmp[1])
Ans.append(nB)
  
nC = int(Tmp[2])
Ans.append(nC)

Ans.sort(reverse='True')

nAns = Ans[0]*10+Ans[1]+Ans[2]
print(nAns)



Fixed submission:
Tmp = []
Tmp = input().rstrip().split(' ')
 
Ans = []
 
nA = int(Tmp[0])
Ans.append(nA)
 
nB = int(Tmp[1])
Ans.append(nB)
  
nC = int(Tmp[2])
Ans.append(nC)
 
Ans.sort(reverse=True)
 
nAns = Ans[0]*10+Ans[1]+Ans[2]
print(nAns)
Buggy python submission (verdict: Runtime Error):
Tmp = []
Tmp = input().rstrip().split(' ')

M = int(Tmp[0])
N = int(Tmp[1])

if M=<N:
    print(N)
else:
    print(N-1)


Fixed submission:
Tmp = []
Tmp = input().rstrip().split(' ')
 
M = int(Tmp[0])
N = int(Tmp[1])
 
if M<=N:
    print(M)
else:
    print(M-1)
Buggy python submission (verdict: Runtime Error):
import sys
N = int(input())

if N == 3:
    print('2 5 63')
    sys.exit()
if N == 4:
    print('2 5 20 63')
    sys.exit()

if N == 5:
    print('2 3 6 4 9')
    sys.exit()

if N = 20000:
    for i in range(5000):
        Tmp1 = 6 * i + 2
        Tmp2 = 6 * i + 3
        Tmp3 = 6 * i + 4
        Tmp4 = 6 * (i + 1)
        print('%d %d %d %d' %(Tmp1,Tmp2,Tmp3,Tmp4), end='')
        if Tmp4 == 30000:
            break
        else:
            print(' ', end='')
    
    print()
    sys.exit()


S = '2 3 6 4 9'

N -= 5

print(S, end='')

if N == 1:
    print(' 12')
    sys.exit()

for i in range(5001):
    
    Tmp1 = 6 * i + 8
    Tmp2 = 6 * i + 10
    if Tmp2 > 30000:
        break
    
    print(' %d %d' %(Tmp1, Tmp2) , end='')
    N -= 2
    if N == 0:
        print()
        sys.exit()
    elif N == 1:
        print(' 12')
        sys.exit()
        
for i in range(5001):
    
    Tmp1 = 12 * i + 15
    Tmp2 = 12 * i + 21
    if Tmp2 > 30000:
        break
    
    print(' %d %d' %(Tmp1, Tmp2), end='')
    N -= 2
    if N == 0:
        print()
        sys.exit()
    elif N == 1:
        print(' 12')
        sys.exit()   

for i in range(N):
    
    Tmp1 = 6 * (i + 3)
    if Tmp1 > 30000:
        break
    
    print(' %d' %(Tmp1) , end='')


print()



Fixed submission:
import sys
N = int(input())

if N == 3:
    print('2 5 63')
    sys.exit()
if N == 4:
    print('2 5 20 63')
    sys.exit()

if N == 5:
    print('2 3 6 4 9')
    sys.exit()

if N == 20000:
    for i in range(5000):
        Tmp1 = 6 * i + 2
        Tmp2 = 6 * i + 3
        Tmp3 = 6 * i + 4
        Tmp4 = 6 * (i + 1)
        print('%d %d %d %d' %(Tmp1,Tmp2,Tmp3,Tmp4), end='')
        if Tmp4 == 30000:
            break
        else:
            print(' ', end='')
    
    print()
    sys.exit()


S = '2 3 6 4 9'

N -= 5

print(S, end='')

if N == 1:
    print(' 12')
    sys.exit()

for i in range(5001):
    
    Tmp1 = 6 * i + 8
    Tmp2 = 6 * i + 10
    if Tmp2 > 30000:
        break
    
    print(' %d %d' %(Tmp1, Tmp2) , end='')
    N -= 2
    if N == 0:
        print()
        sys.exit()
    elif N == 1:
        print(' 12')
        sys.exit()
        
for i in range(5001):
    
    Tmp1 = 12 * i + 15
    Tmp2 = 12 * i + 21
    if Tmp2 > 30000:
        break
    
    print(' %d %d' %(Tmp1, Tmp2), end='')
    N -= 2
    if N == 0:
        print()
        sys.exit()
    elif N == 1:
        print(' 12')
        sys.exit()   

for i in range(N):
    
    Tmp1 = 6 * (i + 3)
    if Tmp1 > 30000:
        break
    
    print(' %d' %(Tmp1) , end='')


print()
Buggy python submission (verdict: Runtime Error):
import sys
 
Tmp = []
Tmp = input().rstrip().split(' ')
A = int(Tmp[0])
B = int(Tmp[1])

for i in range(50):
    for j in range(100):
        if i==0:
            print('.', end='')
            if  j==99:
                print()
               
            continue
        
        if j==0:
            print('.', end='')
            continue
        elif j==99:
            print('.', end='')
                print()
            continue
        else:
            Tmp1 = i % 2
            Tmp2 = j % 2
            
            if (Tmp1 == 1) and (Tmp2 == 1) and (B > 1):
                print('#', end='')
                B -= 1
            elif (Tmp1 == 0) and (Tmp2 == 0) and (B > 1):
                print('#', end='')
                B -= 1
            else:
                print('.', end='')
                
for i in range(50):
    for j in range(100):
        if i==0:
            print('#', end='')
            if  j==99:
                print()
               
            continue
        
        if j==0:
            print('#', end='')
            continue
        elif j==99:
            print('#', end='')
                print()
            continue
        else:
            Tmp1 = i % 2
            Tmp2 = j % 2
            
            if (Tmp1 == 1) and (Tmp2 == 1) and (B > 1):
                print('.', end='')
                B -= 1
            elif (Tmp1 == 0) and (Tmp2 == 0) and (B > 1):
                print('.', end='')
                B -= 1
            else:
                print('#', end='')


Fixed submission:
import sys
 
Tmp = []
Tmp = input().rstrip().split(' ')
A = int(Tmp[0])
B = int(Tmp[1])

#A = 170
#B = 80
print('100 100')

for i in range(50):
    for j in range(100):
        if i==0:
            print('.', end='')
            if  j==99:
                print()
               
            continue
        
        if j==0:
            print('.', end='')
            continue
        elif j==99:
            print('.', end='')
            print()
            continue
        else:
            Tmp1 = i % 2
            Tmp2 = j % 2
            
            if (Tmp1 == 1) and (Tmp2 == 1) and (B > 1):
                print('#', end='')
                B -= 1
            else:
                print('.', end='')
                
for i in range(50):
    for j in range(100):
        if i==0:
            print('#', end='')
            if  j==99:
                print()
            continue
        
        if j==0:
            print('#', end='')
            continue
        elif j==99:
            print('#', end='')
            print()
            continue
        else:
            Tmp1 = i % 2
            Tmp2 = j % 2
            
            if (Tmp1 == 1) and (Tmp2 == 1) and (A > 1):
                print('.', end='')
                A -= 1
            else:
                print('#', end='')
Buggy python submission (verdict: Runtime Error):
nN = int(input())
 
sListA = []
nListA = [ 0 for i in range(nN)]
 
for i in range(nN):
  sTmp = input()
  if sTmp in sListA:
    nTmp = sListA.index(sTmp)
    nListA[nTmp] += 1
  else:
    sListA.append(sTmp)
    nTmp = sListA.index(sTmp)
    nListA[nTmp] += 1
 
    
nN = int(input())
sListB = []
nListB = [ 0 for i in range(nN)]
 
for i in range(nN):
  sTmp = input()
  if sTmp in sListA:
    nTmp = sListA.index(sTmp)
    nListA[nTmp] -= 1
  else:
    sListA.append(sTmp)
    nTmp = sListA.index(sTmp)
    nListA[nTmp] -= 1
 
nMax = max(nListA)
# print(sListA)
print(nMax)


Fixed submission:
N = int(input())
Flag = 0
TmpNum = 0
Count = 0
Data = [[0 for i in range(2)]  for j in range(N)]

for i in range(N):
    TmpS = input()
    Num = i
    if Num == 0:
        Data[i][0] = TmpS
        Data[i][1] = 1
        Count += 1
    else:
        Flag = 0
        for i2 in range(Num):
            if TmpS == Data[i2][0]:
                Flag = 1
                TmpNum = i2
                break
        
        if Flag == 1:
            Data[TmpNum][1] += 1
        else:
            Data[Count][0] = TmpS
            Data[Count][1] = 1
            Count += 1

M = int(input())
for i in range(M):
    TmpS = input()
    for i2 in range(Count):
        if TmpS == Data[i2][0]:
            Data[i2][1] -= 1
            break

Data = sorted(Data, key=lambda x: x[1],  reverse=True) 

Ans = Data[0][1]
if Ans < 0:
    Ans = 0

print(Ans)
Buggy python submission (verdict: Runtime Error):

Tmp = []
Tmp = input().rstrip().split(' ')
A = Tmp[0]
Tmp = input().rstrip().split(' ')
B = Tmp[1]
Tmp = input().rstrip().split(' ')
C = Tmp[2]

print('%s%s%s' %(A,B,C))



Fixed submission:
Tmp = []
Tmp = input()
A = Tmp[0]
Tmp = input()
B = Tmp[1]
Tmp = input()
C = Tmp[2]

print('%s%s%s' %(A,B,C))
Buggy python submission (verdict: Runtime Error):

Tmp = []
Tmp = input().rstrip().split(' ')
A = Tmp[0]
B = Tmp[1]

Ans = 0
Data = A
while Data <= B:
    A = Data // 10000
    B = Data // 1000
    D = Data // 10
    E = Data % 10
    if (A==E) and (B==D):
        Ans += 1
    
    Data += 1 

print(Ans)


Fixed submission:
Tmp = []
Tmp  = input().rstrip().split(' ')

A = int(Tmp[0])
B = int(Tmp[1])

Ans = 0
Data = A
while Data <= B:
    C = Data // 10000
    D = (Data - C * 10000 )// 1000
    E = Data // 100
    F = (Data - E * 100 )// 10
    G = Data % 10
    if (C==G) and (D==F):
        Ans += 1    
    Data += 1 

print(Ans)
Buggy python submission (verdict: Time Limit Exceeded):
Tmp = []
Tmp  = input().rstrip().split(' ')

N = int(Tmp[0])
K = int(Tmp[1])

Ans = 0
Num = K + 1
nTmp = 0
nTmp2 = 0

if K == 0:
    Ans = N**2
else:
    nTmp = int((N - K)*(N - K + 1)/2)
    Ans += nTmp
    while Num < N:
        nTmp2 = N
        while nTmp2 - K >= Num:
            nTmp = nTmp2 % Num
            if nTmp >= K:
                Ans += 1
            
            nTmp2 -= 1
        
        Num += 1


print(Ans)


Fixed submission:
Tmp = []
Tmp  = input().rstrip().split(' ')

N = int(Tmp[0])
K = int(Tmp[1])

Ans = 0
nTmp = 0
nTmp2 = 0
nTmp3 = 0

if K == 0:
  Ans = N **2
else:
    for i in range(N+1):
        if i == 0:
            continue
        B = i
        nTmp = B - K
        if nTmp > 0:
            nTmp2 = N // B
            nTmp3 = (B - K) * nTmp2
            Ans += nTmp3
            nTmp2 = N % B
            if nTmp2 != 0:
                nTmp2 = nTmp2 - K + 1
                if nTmp2 > 0:
                    Ans += nTmp2
    
print(Ans)
Buggy python submission (verdict: Runtime Error):


N = int(input())

Tmp = []
Tmp = input().rstrip().split(' ')

nAns = [ 0 for i in range(4)]
Flag = 0
for i in range(N):
  S = Tmo[i]
  if S=='G':
    Flag = 1

if Flag==1:
  print('Four')
else:
  print('Three')




Fixed submission:
nCount = 0
nP = 0
nW = 0
nG = 0
nY = 0

N = int(input())
nData = []
nData  = input().rstrip().split(' ')

for i in range(N):
    sTmp = nData[i]
    if sTmp == 'P':
        nP = 1
    elif sTmp == 'W':
        nW = 1
    elif sTmp == 'G':
        nG = 1
    elif sTmp == 'Y':
        nY = 1
    
nCount = nP + nW + nG + nY

if nCount == 3:
    print('Three')
else:
    print('Four')
Buggy python submission (verdict: Runtime Error):
N=int(input())
A==int(input())

N %= 500

if A >= N:
  print('Yes')
else:
  print('No')





Fixed submission:

N = int(input())
A = int(input())

Tmp = N % 500

if A >= Tmp:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import sys

N = int(input())
 
A =[ [0 for i in range(2)]for i in range(20)]
 
if N < 20:
    for i in range(N):
 
        print(i)
        print("", flush=True)
    
    S = input()
    if S == 'Vacant':
        sys.exit()
 
else:
    nS = 0
    nE = N - 1
    nT = (N + 1) / 2
    nT2 = nT % 2
    if nT2 == 1:
        nT = nT + 1
    
    nQ = 0
    iTmp = 0
    nCnt = 0
 
    print(nQ)
    print("", flush=True)

    S = input()
    if S == 'Vacant':
        sys.exit()


    nQ = N - 1
    print(nQ)
    print("", flush=True)
    E = input()
    if E == 'Vacant':
        sys.exit()
 
    for i in range(19):
        nQ = ( nS + nE ) / 2
        print(nQ)
        print("", flush=True)
    
        S1 = input()
        if S1 == 'Vacant':
            sys.exit()
 
        nT2 = (nQ - nS) % 2

        if ( nT2 != 0 ) and ( S ==S1 ):
            E = S1
            nE = nQ
        elif ( nT2 == 0 ) and ( S !=S1 ):
            E = S1
            nE = nQ
        elif ( nT2 != 0 ) and ( S !=S1 ):
            S = S1
            nS = nQ
        elif ( nT2 == 0 ) and ( S ==S1 ):
            S = S1
            nS = nQ
        


Fixed submission:
nData = []
nData  = input().rstrip().split(' ')

X = int(nData[0])
Y = int(nData[1])


nFlag = 0

Check = X%Y

if Check != 0:
    N = 10**18//X
    for i in range(N):
        if i<2:
            continue
        Ans = X * i
        Check = Ans%Y
        if Check !=0:
            nFlag = 1
            break
        
    
if nFlag == 0:
    print('-1')
else:
    print(Ans)
Buggy python submission (verdict: Runtime Error):
a, b=map(int,input().split())
n=len(b)
A=a*(10**n)+b

T=(int(A**0.5))**2

if A==T:
  print('Yes')
else:
  print('No')


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

a, b=input().split()
n=len(b)
na = int(a)
nb = int(b)
A=na*(10**n)+nb
 
T=(int(A**0.5))**2
 
if A==T:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):

nN = int(input())


nList = []

nTmp = int(input())
nList.append(nTmp)
nAns = 1

if (nN > 1):
  nTmp = int(input())
  if nTmp in nList:
    continue
  else:
    nList.append(nTmp)
    nAns += 1
  





print(nAns)





Fixed submission:
nN = int(input())
 
nList = []
 
nTmp = int(input())
nList.append(nTmp)
nAns = 1
 
if (nN > 1):  
  for i in range(nN - 1):
    nTmp = int(input())
      
    if nTmp not in nList:
      nList.append(nTmp)
      nAns += 1
    
print(nAns)
Buggy python submission (verdict: Runtime Error):
import sys

N=int(input())

if N==1:
  print(1)
  sys.exit()

Flag=0
nCnt=1
Tmp=2
while Flag=0:
  TmpN = N /Tmp
  if TMpN >= 2:
    Tmp *= 2
    nCnt +=1
  else:
    Flag=1

A = 2 ** (nCnt)
print(A)



Fixed submission:
import sys
 
N=int(input())
 
if N==1:
  print(1)
  sys.exit()

Flag=0
nCnt=1
Tmp=2
while Flag==0:
  TmpN = N /Tmp
  if TmpN >= 2:
    Tmp *= 2
    nCnt +=1
  else:
    Flag=1

A = 2 ** (nCnt)
print(A)
Buggy python submission (verdict: Runtime Error):
import sys

X, Y=map(int,input().split())

if X==2 or Y==2:
  print('No')
  sys.exit()
elif X==4 or X==6 or X==9 or X==11:
  if Y==6 or Y==9 or Y==11:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()
else:
  if Y==3 or Y==5 or Y==7 or Y==8 or Y==10 Y==12:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()  


Fixed submission:
import sys
 
X, Y=map(int,input().split())
 
if X==2 or Y==2:
  print('No')
  sys.exit()
elif X==4 or X==6 or X==9 or X==11:
  if Y==6 or Y==9 or Y==11:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()
else:
  if Y==3 or Y==5 or Y==7 or Y==8 or Y==10 or Y==12:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()
Buggy python submission (verdict: Runtime Error):
Tmp = []
Tmp = input().rstrip().split(',')
 
sA = (Tmp[0])
sB = (Tmp[1])

if sA == 'H' and sB == 'H':
  print('H')
elif sA == 'H' and sB == 'D':
  print('D')
elif sA == 'D' and sB == 'D':
  print('H')
elif sA == 'D' and sB == 'H':
  print('D')


Fixed submission:
Tmp = []
Tmp = input().rstrip().split(' ')
 
sA = (Tmp[0])
sB = (Tmp[1])
 
if sA == 'H' and sB == 'H':
  print('H')
elif sA == 'H' and sB == 'D':
  print('D')
elif sA == 'D' and sB == 'D':
  print('H')
elif sA == 'D' and sB == 'H':
  print('D')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=1
for i in range(N):
  A *= (i+1)
 
# A = (1+N)/2 * N
# print(A)
A %=(10**9+7)
print('%d' %(A))


Fixed submission:
import math
 
N=int(input())
 
A = math.factorial(N)
A %=(10**9+7)

print(A)

Buggy python submission (verdict: Time Limit Exceeded):

N=int(input())
A = 1
for i in range(N):
  A *= (i+1)

A %=(10**9+7)
print(A)


Fixed submission:
import math
 
N=int(input())
 
A = math.factorial(N)
A %=(10**9+7)

print(A)