Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02918 (python)

Fixed submission:
n, k = map(int, input().split())
s = input()
prev = 'e'
flag = 0

count = 0
        
for i in range(n):
    if s[i] == 'L':
        if prev == 'R':
            if k == 0:
                pass
            elif flag == 0:
                flag = 1
            else:
                count += 2
                k -= 1
                flag = 0
        elif prev == 'L':
            count += 1
    else:
        if prev == 'L':
            if k == 0:
                pass
            elif flag == 0:
                flag = 1
            else:
                count += 2
                k -= 1
                flag = 0
        elif prev == 'R':
            count += 1
    if i == n - 1:
        if flag == 1:
            count += 1
    prev = s[i]
    
print(count)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
#s.append('e')
prev = 'e'
flag = 0

count = 0
        
for i in range(n):
    #print(flag)
    if i == n - 1:
        if flag == 1:
            count += 1
    if s[i] == 'L':
        if prev == 'R':
            if k == 0:
                ;
            elif flag == 0:
                flag = 1
            else:
                count += 2
                k -= 1
                flag = 0
        elif prev == 'L':
            count += 1
    else:
        if prev == 'L':
            if k == 0:
                ;
            elif flag == 0:
                flag = 1
            else:
                count += 2
                k -= 1
                flag = 0
        elif prev == 'R':
            count += 1
    prev = s[i]
    
print(count)
Problem p02928 (python)

Fixed submission:
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
x, y = 0, 0
for i in range(n):
    for j in range(n):
        if a[i] > a[j]:
            x += 1
        if (i < j) and (a[i] > a[j]):
            y += 1

output = ((x * k * (k - 1) // 2) + (y * k)) % 1000000007
print(output)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
x, y = 0, 0
for i in range(n):
    for j in range(n):
        if a[i] > a[j]:
            x += 1
        if (i < j) and (a[i] > a[j]):
            y += 1
num_np = np.array(num)
sum_left = sum(num_np[:,0])
sum_right = sum(num_np[:,1])
output = (x * k) % 1000000007 + (y * k * (k - 1) // 2) % 1000000007
print(output % 1000000007)
Problem p02936 (python)

Fixed submission:
import sys
sys.setrecursionlimit(200005) 
input = sys.stdin.readline
n, q = map(int, input().split())
to = [[] for i in range(n)]
ans = [0 for i in range(n)]
def dfs(v, p = -1):
    for u in to[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)
for i in range(n - 1):
    a, b = map(int, input().split())
    to[a - 1].append(b - 1)
    to[b - 1].append(a - 1)
for i in range(q):
    p, x = map(int, input().split())
    ans[p - 1] += x
dfs(0)
print(*ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n, q = map(int, input().split())
to = [[] for i in range(n)]
ans = [0 for i in range(n)]
def dfs(v, p = -1):
    for u in to[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)
for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)
for i in range(q):
    p, x = map(int, input().split())
    p -= 1
    ans[p] += x
dfs(0)
print(" ".join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
to = [[] for i in range(n)]
ans = [0 for i in range(n)]
def dfs(v, p = -1):
    for u in to[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)
for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    #to[b].append(a)
for i in range(q):
    p, x = map(int, input().split())
    p -= 1
    ans[p] += x
dfs(0)
print(" ".join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
to = [[] for i in range(n)]
ans = [0 for i in range(n)]
def dfs(v, p = -1):
    for u in to[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)
for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)
for i in range(q):
    p, x = map(int, input().split())
    p -= 1
    ans[p] += x
dfs(0)
print(" ".join(map(str, ans)))
Problem p02945 (python)

Fixed submission:
a, b = map(int,input().split())
print(max([a+b,a-b,a*b]))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = {}
ans = 0
for i in s:
    count[i] = count.get(i, 0) + 1
for key, value in count.items():
    ans += value * (value - 1) // 2
print(ans)

Buggy submission (verdict: Runtime Error):
from functools import reduce
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = {}
ans = 0
for i in s:
    count[i] = count.get(i, 0) + 1
for key, value in count.items():
    ans += value * (value - 1) // 2
print(ans)
Problem p03355 (python)

Fixed submission:
s = input()
K = int(input())
n1 = list(s)
n2 = [s[i:i+2] for i in range(len(s)-1)]
n3 = [s[i:i+3] for i in range(len(s)-2)]
n4 = [s[i:i+4] for i in range(len(s)-3)]
n5 = [s[i:i+5] for i in range(len(s)-4)]
cat = list(set(n1 + n2 + n3 + n4 + n5))
cat.sort()
#print(cat)
print(cat[K-1])

Buggy submission (verdict: Runtime Error):
s = input()
K = int(input())
n1 = list(s)
n2 = [s[i:i+2] for i in range(len(s)-1)]
n3 = [s[i:i+3] for i in range(len(s)-2)]
cat = list(set(n1 + n2 + n3))
cat.sort()
#print(cat)
print(cat[K-1])
Problem p03243 (python)

Fixed submission:
N=int(input())
if(N<=111):
  print(111)
elif(111<N<=222):
  print(222)
elif(222<N<=333):
  print(333)
elif(333<N<=444):
  print(444)
elif(444<N<=555):
  print(555)
elif(555<N<=666):
  print(666)
elif(666<N<=777):
  print(777)
elif(777<N<=888):
  print(888)
elif(888<N<=999):
  print(999)

Buggy submission (verdict: Runtime Error):
N=int(input())
if(100<N<=111):
  ptit(111)
elif(111<N<=222):
  print(222)
elif(222<N<=333):
  print(333)
elif(333<N<=444):
  print(444)
elif(444<N<=555):
  print(555)
elif(555<N<=666):
  print(666)
elif(666<N<=777):
  print(777)
elif(777<N<=888):
  print(888)
elif(888<N<=999):
  print(999)
Problem p03280 (python)

Fixed submission:
A,B=map(int,input().split())
print((A-1)*(B-1))

Buggy submission (verdict: Runtime Error):
N=int(input())
if(N<105):
  print(0)
elif(105<=N<135):
  print("1")
elif(135<=N<165):
  print("2")
elif(165<=N<189):
  print("3")
elif(189<=N<195):
  print("4")
else:
  print("5")

Buggy submission (verdict: Runtime Error):
N=int(input())
if(N<105):
  print(0)
elif(105<=N<135):
  print(1)
elif(135<=N<165):
  print(2)
elif(165<=N<189):
  print(3)
elif(189<=N<195):
  print(4)
else:
  print(5)

Buggy submission (verdict: Runtime Error):
N=int(input())
if(N<105):
  print(0)
elif(105<=N<165):
  print(1)
elif(165<=N<195):
  print(2)
else:
  print(3)
Problem p03477 (python)

Fixed submission:
A,B,C,D=map(int,input().split())
if(A+B>C+D):
  print("Left")
elif(A+B==C+D):
  print("Balanced")
else:
  print("Right")

Buggy submission (verdict: Runtime Error):
A,B,C,D=map(int,input().split())
if(A+B>C+D):
  print("Left")
elif(A+B==C+D):
  print("Balanced")
else:
  ptint("Right")

Buggy submission (verdict: Runtime Error):
A,B,C,D=map(int,input().split())
if(A+B>C+D):
  print("Left")
elif(A+B==C+D):
  print("Balanced")
else:
  ptinr("Right")
Problem p03623 (python)

Fixed submission:
x,a,b=map(int,input().split())
if(abs(x-a)>abs(x-b)):
  print("B")
else:
  print("A")

Buggy submission (verdict: Runtime Error):
X,t=map(int,input().split())
print(X-t if X-t>0 else 0)
Problem p02958 (python)

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 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')
Problem p03102 (python)

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 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)
Problem p03126 (python)

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 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)
Problem p03146 (python)

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 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)
Problem p03239 (python)

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

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

Buggy 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)
Problem p03359 (python)

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 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)
Problem p03394 (python)

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 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()
Problem p03402 (python)

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 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='')
Problem p03408 (python)

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 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)
Problem p03415 (python)

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 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))
Problem p03416 (python)

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 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)
Problem p03424 (python)

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 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')
Problem p03433 (python)

Fixed submission:

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

Tmp = N % 500

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

Buggy submission (verdict: Runtime Error):
N=int(input())
A==int(input())

N %= 500

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

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 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
Problem p03456 (python)

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