Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

if A>B:
  print("GREATER")
elif A<B:
  print("LESS")
else:
  print("EQUAL")

Fixed submission:
A = int(input())
B = int(input())

if A>B:
  print("GREATER")
elif A<B:
  print("LESS")
else:
  print("EQUAL")

Buggy python submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())

if A>B:
  print("GREATER")
elif A<B:
  print("LESS")
else:
  print("EQUAL")

Fixed submission:
A = int(input())
B = int(input())

if A>B:
  print("GREATER")
elif A<B:
  print("LESS")
else:
  print("EQUAL")
Buggy python submission (verdict: Runtime Error):

l = []

count = 0

for s in input():
    if s == "R":
        count += 1
    else:
        l.append(count)
        count = 0

print(max(l))


Fixed submission:

flag = True
count = 0
l = []

for s in input():
    if flag:
        if s == "R":
            count += 1
            l.append(count)
        else:
            l.append(0)
            count = 0


print(max(l))

Buggy python submission (verdict: Runtime Error):

l = []

count = 0


for s in input():
    if s == "R":
        count += 1
    else:
        l.append(count)
        count = 0

print(max(l))


Fixed submission:

flag = True
count = 0
l = []

for s in input():
    if flag:
        if s == "R":
            count += 1
            l.append(count)
        else:
            l.append(0)
            count = 0


print(max(l))
Buggy python submission (verdict: Runtime Error):
D T S = map(int, input().split(" "))

A = S * T
if A >= D:
    print("Yes")
else:
    print("No")

Fixed submission:
D, T, S = map(int, input().split(" "))

A = S * T
if A >= D:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import heapq

N, K = map(int, input().split(" "))
 
Ps = list(map(int, input().split(" ")))
Cs = list(map(int, input().split(" ")))


max_points = []
heapq.heapify(max_points)
for start_point in range(1, N+1):
    flg = False
    C_point = 0
    max_point = []
    heapq.heapify(max_point)
    now_point = start_point
    for _ in range(K):
        next_point = Ps[now_point-1]
        C_point += Cs[next_point-1]
        
        heapq.heappush(max_point, -C_point)
#        max_point.append(C_point)
        now_point = next_point
    
        if next_point == start_point:
            flg = True
            l = _ + 1
            last_point = C_point
            break
        
    if flg:
#        print("l",l)
        q, r = divmod(K, l)
#        print(q,r)
        now_point = start_point
        C_point = 0
        for _ in range(r):
            next_point = Ps[now_point-1]
            C_point += Cs[next_point-1]
            ins = last_point * q + C_point
            heapq.heappush(max_point, -ins)
#            max_point.append(ins)
            
            now_point = next_point        
#    print("2nd", max_point)
    max_point_ = heapq.heappop(max_point)
    heapq.heappush(max_points, max_point_)
#    max_points.append(max(max_point))
    
print(-heapq.heappop(max_points))
#print(max(max_points))

Fixed submission:
import re

S = input()

rrr = S.count("RRR")
rr = S.count("RR")
r = S.count("R")

if rrr == 1:
    print(3)
elif rr == 1:
    print(2)
elif r == 1 or r == 2:
    print(1)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
import heapq

N, K = map(int, input().split(" "))
 
Ps = list(map(int, input().split(" ")))
Cs = list(map(int, input().split(" ")))


max_points = []
heapq.heapify(max_points)
for now_point in range(2, N+1):
    max_point = -float('inf')
    C_point = 0
    max_point = []
    heapq.heapify(max_point)
    for _ in range(K):
        next_point = Ps[now_point-1]
        C_point += Cs[next_point-1]
        
        heapq.heappush(max_point, -C_point)
        now_point = next_point
    
    max_point_ = heapq.heappop(max_point)
    heapq.heappush(max_points, max_point_)
 
print(-heapq.heappop(max_points))

Fixed submission:
import re

S = input()

rrr = S.count("RRR")
rr = S.count("RR")
r = S.count("R")

if rrr == 1:
    print(3)
elif rr == 1:
    print(2)
elif r == 1 or r == 2:
    print(1)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
X, K, D = map(int, input().split(" "))

X = abs(X)
now = X
over_zero_step = 0
over_zero = 0
not_over_zero = now
flg = 0
for i in range(1, K+1):
    if X < abs(K * D):
        nxt = now - D
    #    print(nxt, i)
        if nxt < 0:
            over_zero = nxt
            not_over_zero = now
            over_zero_step = i
            break
        now = nxt
    else:
        remaining_step = 0
        nearest_point = X - K * D
        flg = 1

if flg == 0:
        
    if abs(over_zero) <= not_over_zero:
        nearest_point = over_zero
        nearest_point_step = over_zero_step
        next_nearest_point = not_over_zero
        remaining_step = K - nearest_point_step
    else:
        nearest_point = not_over_zero
        nearest_point_step = over_zero_step - 1
        next_nearest_point = over_zero
        remaining_step = K - nearest_point_step

#print("rem", remaining_step)
if remaining_step % 2 == 0:
    print(abs(nearest_point))
else:
    print(abs(next_nearest_point))

Fixed submission:
X, K, D = map(int, input().split(" "))

X = abs(X)
now = X
over_zero_step = 0
over_zero = 0
not_over_zero = now
flg = 0

if X < abs(K * D):
    q = X // D
    now = X - q * D
    now = abs(now)
#    print(now, q)    
    for i in range(q+1, K+1):
        nxt = now - D
        if nxt < 0:
            over_zero = nxt
            not_over_zero = now
            over_zero_step = i
            break
        now = nxt
else:
    remaining_step = 0
    nearest_point = X - K * D
    flg = 1

if flg == 0:
        
    if abs(over_zero) <= not_over_zero:
        nearest_point = over_zero
        nearest_point_step = over_zero_step
        next_nearest_point = not_over_zero
        remaining_step = K - nearest_point_step
    else:
        nearest_point = not_over_zero
        nearest_point_step = over_zero_step - 1
        next_nearest_point = over_zero
        remaining_step = K - nearest_point_step

#print("rem", remaining_step)
if remaining_step % 2 == 0:
    print(abs(nearest_point))
else:
    print(abs(next_nearest_point))
Buggy python submission (verdict: Runtime Error):
if x == 0:
    print(1)
else:
    print(0)

Fixed submission:
x = int(input())

if x == 1:
    print(0)
else:
    print(1)
Buggy python submission (verdict: Runtime Error):
lis=list(input().split( ))
 
for i,x in enumerate(lis):
  if x == 0:
    a = i
print a

Fixed submission:
lis=list(map(int,input().split()))
for i, x in enumerate(lis):
  if x == 0:
    a = i+1
print (a)

Buggy python submission (verdict: Runtime Error):
lis=list(input())

for i,x in enumerate(lis):
  if x == 0:
    a = i
print a
  
  


Fixed submission:
lis=list(map(int,input().split()))
for i, x in enumerate(lis):
  if x == 0:
    a = i+1
print (a)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

K = int(input())

def gcd(*numbers):
    return reduce(math.gcd, numbers)

ans = 0

for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd(i,j,k)

print(ans)

Fixed submission:
import math
from functools import reduce

K = int(input())

def gcd(*numbers):
    return reduce(math.gcd, numbers)

ans = 0

for i in range(1, K+1):
    for j in range(i, K+1):
        for k in range(j, K+1):
            if i == j and j ==k:
                ans += i
            elif i==j or j==k or i==k:
                ans += gcd(i,j,k)*3
            else:
                ans += gcd(i,j,k)*6

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split( )))
ans=1
for i in range(n):
    ans*=a[i]
if ans>10**18:
    ans=-1
print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split( )))
ans=1
for i in range(n):
    if a[i]==0:
        ans=0
        break
if ans==0:
    print(0)
else: 
    for i in range(n):
        ans*=a[i]
        if ans>10**18:
            ans=-1
            break
    print(ans)
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
 
bool check(vector<string> A, string S){
     for(string x : A) {
        if(S == x) return false;
    }
    return true;
}

int main(){
    int N, count = 0;
    string S;  
    cin >> N;
    vector<string> A(N);
    for(int i=0;i<N;i++){
        cin >> S;
        if(check(A,S)){
            A.push_back(S);   
            count++;
        }  
    }
    cout << count << endl;
}

Fixed submission:
N = int(input())
L = set({})
for i in range(N):
    L.add(input())
print(len(L))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = []
count = 0
for i in range(N):
    S = input()
    if not S in L:
        L.append(S)
        count += 1
print(count)
    


Fixed submission:
N = int(input())
L = set({})
for i in range(N):
    L.add(input())
print(len(L))
Buggy python submission (verdict: Runtime Error):
X = int(input())
a = X // 500
X -= a * 500
b = X // 5
print(a,b)
print(a*1000+5*

Fixed submission:
X = int(input())
a = X // 500
X -= a * 500
b = X // 5
print(a*1000+5*b)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
count = 0
for i in range(N):
    flag = True
    for j in range(i):
        if P[i] > P[j]: 
            flag = False
            break
    if flag:
        count += 1
print(count)



Fixed submission:
N = int(input())
P = list(map(int,input().split()))
count = 0
minmum = P[0]
for i in range(N):
    if minmum >= P[i]:
        count += 1
        minmum = P[i]
print(count)
Buggy python submission (verdict: Runtime Error):
import bisect
N = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
for i in range(N):
  for j in range(i+1,N):
      add_len = L[i]+L[j]
      idx = bisect.bisect_left(L, add_len)
      ans += max(0, idx-(j+1))
print(ans)
      

Fixed submission:
A,B = map(int,input().split())
curtain_len = A-B*2
if curtain_len > 0:
  print(curtain_len)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = map(int,input().split())
recovery_amount = 0 
for i in range(N):
  for j in range(N):
    if i == j:
      continue
    recovery_amount += d[i]*d[j]
print(recovery_amount)

Fixed submission:
N = int(input())
d = list(map(int,input().split()))
recovery_amount = 0 
for i in range(N):
  for j in range(i,N):
    if i == j:
      continue
    recovery_amount += d[i]*d[j]
print(recovery_amount)
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main(void){
    int N;
    int count = 0;
    cin >> N;
    cout << (int)(((N-1)*(1 + N-1))/2) << endl;
    return 0;
}

Fixed submission:
N = int(input())
print((N-1)*(1 + N-1) // 2)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
array = np.arange(N)
print(sum(array))

Fixed submission:
N = int(input())
print((N-1)*(1 + N-1) // 2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
K = int(input())
for i in range(N):
  if S[i] != S[K]:
    S[i] = "*"
print("".join(S))

Fixed submission:
N = int(input())
S = list(input())
K = int(input())
for i in range(N):
  if S[i] != S[K-1]:
    S[i] = "*"
print("".join(S))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
K = int(input())
for i in range(N):
  if S[i] != S[K]:
    S[i] = "*"
print(S)

Fixed submission:
N = int(input())
S = list(input())
K = int(input())
for i in range(N):
  if S[i] != S[K-1]:
    S[i] = "*"
print("".join(S))
Buggy python submission (verdict: Runtime Error):
import sys
from sys import stdin
input = stdin.readline

INF = 10**9

s = input()
t = input()
ans = 10**10
ls = len(s)
lt = len(t)
for i in range(ls - lt + 1):
  cnt = 0
  for j in range(lt:
    if (s[i+j] != t[j]): cnt += 1
  ans = min(cnt, ans)
print(ans)

Fixed submission:
s = input()
t = input()
ans = 10 ** 10
ls = len(s)
lt = len(t)
for i in range(ls - lt + 1):
    cnt = 0
    for j in range(lt):
        if s[i + j] != t[j]:
            cnt += 1
    ans = min(ans, cnt)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

sum = 0

while(n >= 1):
  sum += n % 10
  n //= 10

if(sum % 9 == 0):
  print("Yes")
else:
  print("No")

Fixed submission:
n = int(input())

# sum = 0

# while(n >= 1):
#   sum += n % 10
#   n //= 10

if(n % 9 == 0):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = list(map(int, input().split()))
c = 0
for i in range(a-1):
  for j in range(1,a-i):
     c += b[i]*b[i+j]
print(c % (10**9+7))



Fixed submission:
a = int(input())
b = list(map(int, input().split()))
c = 0
sum = sum(b)
for i in range(a-1):
  sum = sum - b[i]
  c += b[i]*(sum)
print(c%(10**9+7))
Buggy python submission (verdict: Runtime Error):
a = input()
if "RRR" in a:
  print(3)
elif "RR" in a:
  print(2)
elif "R" in a:
  print(1)
else:a
  print(0)


Fixed submission:
a = input()
if "RRR" in a:
  print(3)
elif "RR" in a:
  print(2)
elif "R" in a:
  print(1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
A = list(map(int, input().split()))
r = max(A)
l = 0
while l+1<r:
  mid=(l+r)//2
  if sum([a-1]//mid for a in A)>k:
    l=mid
  else:
    r = mid
print(r)


Fixed submission:
n,k=map(int,input().split())
A = list(map(int, input().split()))
r = max(A)
l = 0
while l+1<r:
  mid=(l+r)//2
  if sum([(a-1)//mid for a in A])>k:
    l=mid
  else:
    r = mid
print(r)
Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = 1
d = []
for i in range(a[0]-a[1]+1):
  for j in range(i, i+a[1]):
    c *= b[j] 
  d.append(c)
  c = 1
for k in range(a[0]-a[1]):
  if d[k] < d[k+1]:
    print("Yes")
  else:
    print("No")

Fixed submission:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(a[0]-a[1]):
  if b[i] < b[i+a[1]]:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
h, w, k = map(int, input().split())
X = [[1 if a == "#" else 0 for a in input()] for _ in range(H)
ans = 0
for ii in range(1 << h):
  for jj in range(1 << w):
    if sum([sum([X[i][j] for j in range(w) if jj >> j & 1]) for i in range(h) if ii >> i & 1]) == k:
      ans += 1
print(ans)
     
     

Fixed submission:
h, w, k = map(int, input().split())
X = [[1 if a == "#" else 0 for a in input()] for _ in range(h)]
ans = 0
for ii in range(1 << h):
  for jj in range(1 << w):
    if sum([sum([X[i][j] for j in range(w) if jj >> j & 1]) for i in range(h) if ii >> i & 1]) == k:
      ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = list(map(int,input().split()))
c = 1
for i in range(a):
  c = c * b[i]
if c > 10 ** 18:
  print(-1)
else:
  print(c)

Fixed submission:
a = int(input())
b = list(map(int,input().split()))
c = 1
if 0 in b:
  print(0)
else:
  for i in range(a):
    c = c * b[i]
    if c > 10 ** 18:
      break
  if c > 10 ** 18:
    print(-1)
  else:
    print(c)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
d={}
for k in range(2,10**6):
  while n%k<1: n//k; d[k]=d.get(k,0)+1
a=0
for i in d.values():
  t=c=0
  while t+c<i: c+=1; t+=c
  a+=c
print(a+(n>1))

Fixed submission:
n=int(input())
d={}
for k in range(2,10**6):
  while n%k<1: n//=k; d[k]=d.get(k,0)+1
a=0
for i in d.values():
  t=c=0
  while t+c<i: c+=1; t+=c
  a+=c
print(a+(n>1))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
d={}
for k in range(2, 10**6):
  while n%k<1: n//k; d[k]=d.get(k, 0)+1
a=0
for i in d.values():
  t=c=0
  while t+c<i: c+=1; t+=c
  a+=c
print(a+(n>1))


Fixed submission:
n=int(input())
d={}
for k in range(2,10**6):
  while n%k<1: n//=k; d[k]=d.get(k,0)+1
a=0
for i in d.values():
  t=c=0
  while t+c<i: c+=1; t+=c
  a+=c
print(a+(n>1))
Buggy python submission (verdict: Runtime Error):
import networkx as nx
n,m=map(int,input().split())
s=[list(map(int,input().split())) for i in range(m)]

g=nx.Graph()
g.add_edges_from(s)
di=nx.predecessor(g,source=1)

print("Yes)
for x in range(2,n+1):
      print(di[x][0])


Fixed submission:
import networkx as nx
n,m=map(int,input().split())
s=[list(map(int,input().split())) for i in range(m)]

g=nx.Graph()
g.add_edges_from(s)
di=nx.predecessor(g,source=1)

print("Yes")
for x in range(2,n+1):
      print(di[x][0])
Buggy python submission (verdict: Runtime Error):
import sys
X = int(inout())
a = 1
b = 0
for a in rangr(1, 120):
  for b in range(-119, a):
    if pow(a, 5) - pow(b, 5) == X:
      print(a,b)
      sys.exit()

Fixed submission:
import sys
X = int(input())
a = 1
b = 0
for a in range(1, 120):
  for b in range(-119, a):
    if pow(a, 5) - pow(b, 5) == X:
      print(a,b)
      sys.exit()
Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(1, a[0]+1):
  print(b.count(i))

Fixed submission:
n,*a=map(int,open(0).read().split())
b=[0]*n
for i in a:
  b[i-1]+=1
print(*b, sep="\n")
Buggy python submission (verdict: Runtime Error):
lst = [1,2,3]
a,b=(int(x) for x in input().split())
lst.remove(a)
lst.remove(b)
print(lst)

Fixed submission:
lst = [1,2,3]
l = [int(input()) for i in range(2)]
lst.remove(l[0])
lst.remove(l[1])
print(lst[0])

Buggy python submission (verdict: Runtime Error):
lst = [1,2,3]
l = list(map(int, input().split()))
lst.remove(l[0])
lst.remove(l[1])
print(lst)

Fixed submission:
lst = [1,2,3]
l = [int(input()) for i in range(2)]
lst.remove(l[0])
lst.remove(l[1])
print(lst[0])
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
c = 0
for i in range(a):
  c +=i
print(c)

Fixed submission:
a = int(input())
print((a)*(a-1)//2)
Buggy python submission (verdict: Runtime Error):
a = list(map(int.input().split()))
print(max(0,a[2]-(a[0]-a[1])))

Fixed submission:
a = list(map(int,input().split()))
print(max(0,a[2]-(a[0]-a[1])))
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = [int(input()) for i in range(a)]
c = sorted(b)[-2]
if b.count(max(b)) >= 2:
  for i in range(a):
    print(max(b))
else:
  for i in b:
    if i == max(b):
      print(c)
    else:
      print(max(b))

Fixed submission:
a = int(input())
b = [int(input()) for i in range(a)]
c = sorted(b)[-2]
d = max(b)
if b.count(d) >= 2:
  for i in range(a):
    print(d)
else:
  for i in b:
    if i == d:
      print(c)
    else:
      print(d)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
if a[0]*a[1]<=a[2]:
  prnit(a[0]*a[1])
else:
  print(a[2])


Fixed submission:
a = list(map(int,input().split()))
if a[0]*a[1]<=a[2]:
  print(a[0]*a[1])
else:
  print(a[2])
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
d = 0
i = 0
while d <= a[1]:
  d += b[i]
  c += 1
  i += 1
print(c)

Fixed submission:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 1
d = 0
for i in b:
  d += i
  if d <= a[1]:
    c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
s = input()
n1 = int(s[:2])
n2 = int(s[2:])
if 1 <= n1 <= 12 and 1 <= n2 <= 12:
  print("AMBIGUOUS)
elif (n1 > 12 or n1 == 0) and 1 <= n2 <= 12:
  print("YYMM")
elif (n2 > 12 or n2 == 0) and 1 <= n1 <= 12:
  print("MMYY")
else:
  print("NA")

Fixed submission:
s = input()
n1 = int(s[:2])
n2 = int(s[2:])
if 1 <= n1 <= 12 and 1 <= n2 <= 12:
  print("AMBIGUOUS")
elif (n1 > 12 or n1 == 0) and 1 <= n2 <= 12:
  print("YYMM")
elif (n2 > 12 or n2 == 0) and 1 <= n1 <= 12:
  print("MMYY")
else:
  print("NA")
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().strip().split())
c = 0
for i in range(1,n+1):
  if n>k:
    c+=1/n
  else:
    cnt=0
    while i<k:
      i*=2
      cnt+=1
    c+=1/N*(1/2)**cnt
print(c)


Fixed submission:
n,k = map(int,input().strip().split())
c = 0
for i in range(1,n+1):
  if i>k:
    c+=1/n
  else:
    cnt=0
    while i<k:
      i*=2
      cnt+=1
    c+=1/n*(1/2)**cnt
print(c)
Buggy python submission (verdict: Runtime Error):
a,b = map(int(input().split()))
print(a+b//2)


Fixed submission:
a,b = map(int,input().split())
print(a+b//2)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin,stdout
n,k=list(map(int,stdin.readline().split()));l=[];s=[];M=998244353
for _ in range(k):
    x,y=list(map(int,stdin.readline().split()))
    l+=[[x,y]]
for stp in range(n+1):
    for x,y in l:
        if x<=stp<=y:s+=[stp]
dp=[0]*(n+1);dp[1]=1
for i in range(2,n+1):
     for steps in s:
         if steps>=i:break
         dp[i]=(dp[i]+dp[i-steps])%M
print(dp[n])

Fixed submission:
from sys import stdin,stdout
def ws(pos,win):
    l,r=win
    l1=pos-r
    r1=pos-l
    l=max(l1,0)
    r=max(r1,0)
    # print(pos,l,r)
    sm=ps[r]-(ps[l-1] if l>=1 else 0)
    return (sm+M)%M
n,k=list(map(int,stdin.readline().split()));w=[];s=[];M=998244353
for _ in range(k):
    x,y=list(map(int,stdin.readline().split()))
    w+=[[x,y]]
dp=[0]*(n+1);dp[1]=1;ps=[0,1]
for i in range(2,n+1):
    for win in w:
        ans=ws(i,win)
        dp[i]=(dp[i]+ans)%M
    ps+=[ps[-1]+dp[i]]
# print(dp)
# print(ps)
print(dp[n])
Buggy python submission (verdict: Runtime Error):
print(1-int(input())

Fixed submission:
n=int(input())
print(1-n)
Buggy python submission (verdict: Runtime Error):
from sys import stdin,stdout
from collections import defaultdict
# n=int(stdin.readline())
def dfs(src):
    global sz
    vis[src]=1
    sz+=1
    for neigh in g[src]:
        if not vis[neigh]:
            dfs(neigh)

n,eg=list(map(int,stdin.readline().split()))
g=defaultdict(list)
for i in range(eg):
    A,B=map(int,stdin.readline().split())
    g[A]+=[B]
    g[B]+=[A]
vis=[0]*(n+1);ans=0
for node in range(1,n+1):
    if not vis[node]:
        sz=0
        dfs(node)
        ans=max(ans,sz)
print(ans)

Fixed submission:
from sys import stdin,stdout
from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)
# n=int(stdin.readline())
def dfs(src):
    global sz
    vis[src]=1
    sz+=1
    for neigh in g[src]:
        if not vis[neigh]:
            dfs(neigh)

n,eg=list(map(int,stdin.readline().split()))
g=defaultdict(list)
for i in range(eg):
    A,B=map(int,stdin.readline().split())
    g[A]+=[B]
    g[B]+=[A]
vis=[0]*(n+1);ans=0
for node in range(1,n+1):
    if not vis[node]:
        sz=0
        dfs(node)
        ans=max(ans,sz)
print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import stdin,stdout
for _ in range(1):#int(stdin.readline())):
    # n=int(stdin.readline())
    x,k,d=list(map(int,stdin.readline().split()))
    if x==k==d:
        print(0 if k&1 else x)
        continue
    des=x%d
    op=x//d
    a=[des,des-d]
    if k<=op:#check for eq
        print(x-k*d)
    else:
        print(abs(a[k%op]))

Fixed submission:
from sys import stdin,stdout
for _ in range(1):#int(stdin.readline())):
    # n=int(stdin.readline())
    x,k,d=list(map(int,stdin.readline().split()))
    '''if x==k==d:
        print(0 if k&1 else x)
        continue'''
    x=abs(x)
    des=x%d
    op=x//d
    # print(des,op)
    a=[des,des-d]
    if k<op:#check for eq
        print(x-k*d)
    else:
        print(abs(a[(k-op)%2]))