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

Fixed submission:
N, K = map(int,input().split())
H = input().split()
H_i = [int(h) for h in H]

print(sum(h>=K for h in H_i))

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
H = input().split()
H_i = [int(h) for h in H]

print(sum(h>K for h in H_i)
Problem p03071 (python)

Fixed submission:
Number= list(map(int, input().split()))
Number.sort()
if Number[0] == Number[1]:
    print(sum(Number))
else:
    print(Number[1]*2 -1)

Buggy submission (verdict: Runtime Error):
Number= list(map(int, input().split()))
Number.sort()
if Number[0] == Number[1]:
    print(Number.sum())
else:
    print(Number[1]*2 -1)

Buggy submission (verdict: Runtime Error):
Number= list(map(int, input().split()))
Number.sort()
if Number[0] == Number[1]:
    print(sum(Number))
else:
    print(f'{Number[1]*2 -1}')

Buggy submission (verdict: Runtime Error):
Number= list(map(int, input().split()))
Number.sort()
if Number[0] == Number[1]:
    print(sum(Number))
else:
    print(f'{Number[1]*2 -1}')

Buggy submission (verdict: Runtime Error):
Number= list(map(int, input().split()))
Number.sort()
if Number[0] == Number[1]:
    print(Number.sum())
else:
    print(Number[1]*2 -1)

Buggy submission (verdict: Runtime Error):
Number= list(map(int, input().split()))
Number.sort()
if Number[0] == Number[1]:
    print(Number.sum())
else:
    print(f'{Number[1]*2 -1}')
Problem p03643 (python)

Fixed submission:
N = input()
print('ABC'+ N)

Buggy submission (verdict: Runtime Error):
N = input()
print(f'ABC{N}')
Problem p03644 (python)

Fixed submission:
import sys
N = int(input())
evens = [i for i in range(1, N+1) if i%2 ==0]
even_cnts = []
if evens == []:
    print(1)
    sys.exit()
for even in evens:
    cnt = 0
    while even % 2 ==0:
        cnt += 1
        even = even / 2
    even_cnts.append(cnt)
max_cnts = max(even_cnts)
index = even_cnts.index(max_cnts)
print(evens[index])

Buggy submission (verdict: Runtime Error):
N = int(input())
evens = [i for i in range(1, N+1) if i%2 ==0]
even_cnts = []
for even in evens:
    cnt = 0
    while even % 2 ==0:
        cnt += 1
        even = even / 2
    even_cnts.append(cnt)
max_cnts = max(even_cnts)
index = even_cnts.index(max_cnts)
print(evens[index])
Problem p02603 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
money = 1000
stock = 0
 
for i in range(N):
    if i == N-1:
        money += stock * A[i]
        break
    if A[i] < A[i+1]:
        tmp_stock = money // A[i]
        stock += tmp_stock
        money -= tmp_stock * A[i]
    elif A[i] > A[i+1]:
        money += stock * A[i]
        stock = 0
    else:
        pass
 
print(money)

Buggy submission (verdict: Runtime Error):
_ = int(input())
kakaku = list(map(int, input().split()))

money = 1000
num_item = 0

up_flag = False
down_flag = False

if kakaku[0] < kakaku[1]:
    up_flag = True
else:
    down_flag = True

dp = []

if up_flag:
    dp.append(kakaku[0])

# 減=>増=>減....の形にする
for i in range(1, len(kakaku)):
    # いま増加中or下後中
    if kakaku[i - 1] > kakaku[i]:
        if down_flag:
            pass
        else:
            down_flag=True
            up_flag=False
            dp.append(kakaku[i-1])
        down_flag = True
    elif kakaku[i-1] < kakaku[i]:
        if up_flag:
            pass
        else:
            down_flag = False
            up_flag = True
            dp.append(kakaku[i-1])
        up_flag = True
    # print('up', up_flag, 'down', down_flag, 'now item',kakaku[i], 'dp', dp)

if kakaku[-2] < kakaku[-1]:
    if kakaku[-3] < kakaku[-2]:
        dp[-1] = kakaku[-1]
    else:
        dp.append(kakaku[-1])

# print(dp)

for i in range(len(dp)):
    if i % 2 == 0:
        num_item += money // dp[i]
        money -= dp[i] * num_item
    else:
        money += dp[i] * num_item
        num_item = 0
if num_item != 0:
    money += num_item * dp[-1]

print(money)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

money = 1000
num_item = 0

kakaku = []

# かぶりをなくす
for i in a:
    if len(kakaku) == 0:
        kakaku.append(i)
    else:
        if kakaku[-1] == i:
            pass
        else:
            kakaku.append(i)

dp = []
MAX = 10000
MIN = -1
tmp_min = MAX
tmp_max = MIN

up_flag = False
down_flag = False

if kakaku[0] < kakaku[1]:
    up_flag = True
else:
    down_flag = True

if up_flag:
    dp.append(kakaku[0])

# 減=>増=>減....の形にする
for i in range(1, len(kakaku)):
    # いま増加中or下後中
    if kakaku[i - 1] > kakaku[i]:
        if down_flag:
            pass
        else:
            down_flag=True
            up_flag=False
            dp.append(kakaku[i-1])
        down_flag = True
    else:
        if up_flag:
            pass
        else:
            down_flag = False
            up_flag = True
            dp.append(kakaku[i-1])
        up_flag = True
    # print('up', up_flag, 'down', down_flag, 'now item',kakaku[i], 'dp', dp)

if kakaku[-2] < kakaku[-1]:
    dp.append(kakaku[-1])

for i in range(len(dp)):
    if i % 2 == 0:
        num_item += money // dp[i]
        money -= dp[i] * num_item
    else:
        money += dp[i] * num_item
        num_item = 0

if num_item != 0:
    money += dp[-1] * num_item

print(money)
Problem p02630 (python)

Fixed submission:
import collections

n = int(input())
a = list(map(int,input().split()))
q = int(input())

collect_dict = dict(collections.Counter(a))

now = sum(a)

ans = []
for i in range(q):
    b, c = map(int,input().split())
    if b not in collect_dict.keys():
        ans.append(now)
        continue
    now -= collect_dict[b] * b
    tmp = collect_dict[b]
    collect_dict.pop(b)
    if c not in collect_dict.keys():
        collect_dict[c] = 0
    collect_dict[c] += tmp
    now += c * tmp
    ans.append(now)

for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())
a = list(map(int,input().split()))
q = int(input())

collect_dict = dict(collections.Counter(a))

now = sum(a)

ans = []
for i in range(q):
    b, c = map(int,input().split())
    now -= collect_dict[b] * b
    tmp = collect_dict[b]
    collect_dict.pop(b)
    if c not in collect_dict.keys():
        collect_dict[c] = 0
    collect_dict[c] += tmp
    now += c * tmp
    ans.append(now)

for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())
a = list(map(int,input().split()))
q = int(input())

collect_dict = dict(collections.Counter(a))

now = sum(a)

ans = []
for i in range(q):
    b, c = map(int,input().split())
    now -= collect_dict[b] * b
    tmp = collect_dict[b]
    collect_dict.pop(b)
    collect_dict[c] += tmp
    now += c * tmp
    ans.append(now)

for i in ans:
    print(i)
Problem p02705 (python)

Fixed submission:
import math

n = int(input())
print(2*n*math.pi)

Buggy submission (verdict: Runtime Error):
//参考：http://ehafib.hatenablog.com/entry/2015/12/23/164517
//インクルード
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 10000007 //10^9+7
#define PB push_back
#define MP make_pair
#define F first
#define S second
// #MAXR 100000 //10^5:最大のrange(素数列挙などで使用)

int main(int argc, char const *argv[]) {
  float n;
  std::cin >> n;
  std::cout << n*2*M_PI << '\n';
  return 0;
}
Problem p02843 (python)

Fixed submission:
list = [100,101,102,103,104,105]
# a = [list[i] * 2000 for i in range(len(list))]

N = int(input())

dp = [0 for i in range(N+1)]
dp[0] = 1

for i in range(N):
    if dp[i] == 1:
        for j in range(len(list)):
            if i + list[j] <= len(dp)-1:
                
                dp[i+list[j]]=1


print(dp[-1])

Buggy submission (verdict: Runtime Error):
list = [100,101,102,103,104,105]

def search(list, target):
    for i in list:
        target = target - i
        if target == 0:
            return True
        elif target <= 0:
            return
        else:
            search(list,target)

s = search(list,int(input()))

if s:
    print(1)
else:
    print(0)
Problem p02865 (python)

Fixed submission:
i = int(input())

print((i-1)//2)

Buggy submission (verdict: Runtime Error):
def selectionsort(a,n):
  counter = 0
  for i in range(n-1):
    idx = None
    mi = a[i]
    flag = False
    for x in reversed(range(i,n)):
      if mi > a[x]:
        idx = x
        mi = a[x]
        counter+=1
        flag = True
    if flag:
      a[i],a[idx] = a[idx],a[i]
    if counter > n - 2:
      return a, True
  return a, counter
 
len = int(input())
a = sorted([int(i) for i in input().split(" ")])
b = [int(i) for i in input().split(" ")]
b, counter = selectionsort(b,len)

Flag = True

if counter:
  print("No")


else:
  for i in range(len):
    if a[i] > b[i]:
      print("No")
      Flag = False
      break
      

  if Flag:
    print("Yes")
Problem p04044 (python)

Fixed submission:
a = input().split(" ")
s = [input() for i in range(int(a[0]))]
print("".join(sorted(s)))

Buggy submission (verdict: Runtime Error):
a = input().split(" ")
s = [input() for i in range(a)]
print("".join(sorted(s))
Problem p02830 (python)

Fixed submission:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n=int(input())
s,t=input().split()
ans=""
for i in range(n):
    ans+=s[i]
    ans+=t[i]
print(ans)

Buggy submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n=int(input())
s=input()
t=input()
ans=""
for i in range(n):
    ans+=s[i]
    ans+=t[i]
print(ans)
Problem p02910 (python)

Fixed submission:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
s=input()
poss=True
for i in range(len(s)):
    if(i%2==0):
        if(s[i]=='L'):
            poss=False
            break
    else:
        if(s[i]=='R'):
            poss=False
            break
if(poss):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
s=input()
poss=True
for i in range(len(s)):
    if(i%2==0):
        if(s[i]!='R'or):
            poss=False
            break
    else:
        if(s[i]=='R'):
            poss=False
            break
if(poss):
    print("Yes")
else:
    print("No")
Problem p03814 (python)

Fixed submission:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a=input()
A=0
Z=0
Adone=False
for i in range(len(a)):
    if(a[i]=='A' and not Adone):
        A=i 
        Adone=True
    elif(a[i]=='Z'):
        Z=i 
ans=Z-A+1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a=input()
A=math.inf
Z=0
for i in range(len(a)):
    if(a[i]=='A'):
        A=min(A,i)
    elif(a[i]=='Z'):
        Z=i 
ans=Z-A+1
if(ans==-math.inf):
    print(0)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a=input()
A=math.inf
Z=0
for i in range(len(a)):
    if(a[i]=='A'):
        A=min(A,i)
    elif(a[i]=='Z'):
        Z=i 
print(Z-A+1)

Buggy submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a=input()
A=math.inf
Z=0
for i in range(len(a)):
    if(a[i]=='A'):
        A=min(A,i)
    elif(a[i]=='Z'):
        Z=i 
print(Z-A+1)
Problem p02713 (python)

Fixed submission:
K = int(input())

g2 = [[0]*(K+1) for _ in range(K+1)]
def gcd(a, b):
    if g2[a][b] > 0:
        return g2[a][b]
    tmpa = a
    tmpb = b
    while b > 0:
        a,b = b, a%b
    g2[tmpa][tmpb] = a
    g2[tmpb][tmpa] = a
    return a

def gcd_3(a,b,c):
    g = gcd(a,b)
    g = gcd(g,c)
    return g

sm = 0
for a in range(1, K+1):
    sm += a
    for b in range(a+1, K+1):
        for c in range(b+1, K+1):
            sm += gcd_3(a,b,c) * 6
    for b in range(1, K+1):
        if a != b:
            sm += gcd(a,b) * 3

print(sm)

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())

g2 = [[0]*(K+1) for _ in range(K+1)]
def gcd(a, b):
    if g2[a][b] > 0:
        return g2[a][b]
    tmpa = a
    tmpb = b
    while b > 0:
        a,b = b, a%b
    g2[tmpa][tmpb] = a
    g2[tmpb][tmpa] = a
    return a

def gcd_3(a,b,c):
    g = gcd(a,b)
    g = gcd(g,c)
    return g

sm = 0
for a in range(1, K+1):
    for b in range(a+1, K+1):
        for c in range(b+1, K+1):
            sm += gcd_3(a,b,c)

print(sm)

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())

g2 = [[0]*(K+1) for _ in range(K+1)]
def gcd(a, b):
    if g2[a][b] > 0:
        return g2[a][b]
    tmpa = a
    tmpb = b
    while b > 0:
        a,b = b, a%b
    g2[tmpa][tmpb] = a
    g2[tmpb][tmpa] = a
    return a

def gcd_3(a,b,c):
    g = gcd(a,b)
    g = gcd(g,c)
    return g

sm = 0
for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):

print(sm)
Problem p02802 (python)

Fixed submission:
n, m = map(int, input().split())
p = []
s = []

for i in range(0, m):
    pi, si = map(str, input().split())
    p.append( int(pi) )
    s.append( si )


done = []
for i in range(0,n):
    done.append(False)
wa_num = []
for i in range(0,n):
    wa_num.append(0)

ac = 0
for i in range(0, m):
    num = p[i] - 1
    if not done[num]:
        if s[i] == 'WA':
            wa_num[num] += 1
        else: # 'AC':
            ac += 1
            done[num] = True

wa = 0
for i in range(0,n):
    if done[i]:
        wa += wa_num[i]

print(ac, wa)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
p = []
s = []

for i in range(0, m):
    pi, si = map(str, input().split())
    p.append( int(pi) )
    s.append( si )


done = []
for i in range(0,n):
    done.append(False)

wa = 0
ac = 0
for i in range(0, m):
    if not done[p[i]]:
        if s[i] == 'WA':
            wa += 1
        else: # 'AC':
            ac += 1
            done[p[i]] = True

print(ac, wa)
Problem p02837 (python)

Fixed submission:
def dudge(k):
    for i in reversed(range(n)):
        p = (k >> i) % 2
        #print(' i = ', i, ' p = ', p)
        if p == 0: continue

        for claim in xy[i]:
            x = claim[0]
            y = claim[1]

            truth = (k >> x-1) % 2
            #print('   x = ', x,  ' y = ', y, ' t = ', truth)
            if truth == 1 and y == 0:
                return False
            elif truth == 0 and y == 1:
                return False
    return True


n = int(input())

xy = []
for i1 in range(n):
    ai = int(input())
    xy.append([])

    for i2 in range(ai):
        xi,yi = map(int, input().split())
        xy[i1].append((xi, yi))

#print(xy)

result = 0
for k in reversed(range(1 << n)):
    #print(bin(k))

    if dudge(k):
        #print('    True')
        #l = [i for i in range(n) if (k >> i) % 2 == 1]
        cnt = 0
        for i in range(n):
            if (k >> i) % 2 == 1: cnt += 1
        #print('    ', l, len(l))
        #result = max(result, len(l))
        result = max(result, cnt)

print(result)

Buggy submission (verdict: Runtime Error):
def dudge(k):
    for i in reversed(range(n)):
        p = (k >> i) % 2
        if p == 0: continue

        for claim in xy[i]:
            x = claim[0]
            y = claim[1]

            truth = (k >> x-1) % 2
            if truth == 1 and y == 0:
                return False
            elif truth == 0 and y == 1:
                return False
    return True


n = int(input())

xy = []
for i1 in range(n):
    ai = int(input())
    xy.append([])

    for i2 in range(ai):
        xi,yi = map(int, input().split())
        xy[i1].append((xi, yi))


        result = 0
for k in reversed(range(1 << n)):

    if dudge(k):
        l = [i for i in range(n) if (k >> i) % 2 == 1]
        result = max(result, len(l))

print(result)
Problem p02972 (python)

Fixed submission:
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))

m = 0
ans = [0]*N
for i in range(N, 0, -1):
    a = A[i-1]
    cnt = 0
    for k in range(i+i, N+1, i):
        cnt += ans[k-1]
    if a != cnt % 2:
        ans[i-1] = 1
        m += 1

print(m)
for i in range(N):
    if ans[i] > 0:
        print(i+1, end=' ')
print()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))

m = 0
ans = [0]*N
for i in range(N, 0, -1):
    a = A[i-1]
    cnt = 0
    for k in range(i+i, N+1, i):
        cnt += A[k-1]
    if a != cnt % 2:
        ans[i] = 1
        m += 1

print(m)
for an in ans:
    if an > 0:
        print(an, end=' ')
print()
Problem p02995 (python)

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

def gcd(a, b):
    while b > 0:
        a,b = b, a%b
    return a

def count(n):
    c = n//C
    d = n//D
    g = gcd(C, D)
    l = C*D//g
    return n -c -d +n//l

print(count(B) - count(A-1))

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())

def gcd(a, b):
    while b > 0:
        a,b = b, a%b
    return a

def count(n):
    c = n//C
    d = n//D
    g = gcd(C, D)
    l = C*D//gcd
    return n -c -d +n//l

print(count(B) - count(A-1))
Problem p03044 (python)

Fixed submission:
import sys
sys.setrecursionlimit(500*500)

N = int(input())
UVW = [list(map(int, input().split())) for _ in range(N-1)]

nbors = [[] for _ in range(N+1)]
for uvw in UVW:
    u,v,w = uvw[0], uvw[1], uvw[2]
    nbors[u].append((v, w))
    nbors[v].append((u, w))

dist = [-1] * (N+1)
dist[1] = 0
def dfs(now, nxt, w):
    if dist[nxt] >= 0:
        return
    dist[nxt] = dist[now] + w
    for nbor in nbors[nxt]:
        nxt2, w = nbor[0], nbor[1]
        dfs(nxt, nxt2, w)

for nbor in nbors[1]:
    nxt, w = nbor[0], nbor[1]
    dfs(1, nxt, w)

for i in range(1, N+1):
    if dist[i] % 2 == 0:
        print(0)
    else:
        print(1)

Buggy submission (verdict: Runtime Error):
N = int(input())
UVW = [list(map(int, input().split())) for _ in range(N-1)]

nbors = [[] for _ in range(N+1)]
for uvw in UVW:
    u,v,w = uvw[0], uvw[1], uvw[2]
    nbors[u].append((v, w))
    nbors[v].append((u, w))

dist = [-1] * (N+1)
dist[1] = 0
def dfs(now, nxt, w):
    if dist[nxt] >= 0:
        return
    dist[nxt] = dist[now] + w
    for nbor in nbors[nxt]:
        nxt2, w = nbor[0], nbor[1]
        dfs(nxt, nxt2, w)

for nbor in nbors[1]:
    nxt, w = nbor[0], nbor[1]
    dfs(1, nxt, w)

for i in range(1, N+1):
    if dist[i] % 2 == 0:
        print(0)
    else:
        print(1)
Problem p02600 (python)

Fixed submission:
M = int(input())

if 400<= M <=599:
    print("8")
elif 600<= M <=799:
    print("7")
elif 800<= M <=999:
    print("6")
elif 1000<= M <=1199:
    print("5")
elif 1200<= M <=1399:
    print("4")
elif 1400<= M <=1599:
    print("3")
elif 1600<= M <=1799:
    print("2")
elif 1800<= M <=1999:
    print("1")

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))

cnt = 1
result = []
AA = len(A[K-1:])

rresult = []
for i in range(AA):
    result_a = 1
    result = A[i:i+K]
    for t in result:
        result_a *= t
    rresult.append(result_a)

for t in range(len(rresult)):
    if t == 0:
        continue
    else:
        if rresult[t] > rresult[t-1]:
            print("Yes")
        else:
            print("No")
Problem p02612 (python)

Fixed submission:

def f(y):

    if 1 <= y <=999:
        print(1000-y)
    elif 1000<= y <= 10000 :
        b = int(y / 100)
        c = int(str(b)[1])
        g = 9-c
        h = int(y/10)
        i = int(str(h)[2])

        if y %1000==0:
            print("0")
        elif y % 500==0 and y % 1000!=0:
            print("500")
        elif y % 100==0 and y % 500!=0:
            f = 10-c
            print(f*100)
        elif y % 10 ==0 and y % 100!=0:
            j =10-i
            print(g*100+j*10)
        elif y % 10!=0:
            k = int(str(y)[3])
            l = 9 - i
            m = 10-k
            print(g*100+l*10+m)


y = input()
x = f(int(y))

Buggy submission (verdict: Runtime Error):

def f(y):

    if 1 <= y <=999:
        print(1000-y)
    elif 1000<= y <= 10000 :
        b = int(y / 100)
        c = int(str(b)[1])
        g = 9-c
        h = int(y/10)
        i = int(str(h)[2])

        if y %1000==0:
            print("0")
        elif y % 500==0 and x % 1000!=0:
            print("500")
        elif y % 100==0 and x % 500!=0:
            f = 10-c
            print(f*100)
        elif y % 10 ==0 and x % 100!=0:
            j =10-i
            print(g*100+j*10)
        elif y % 10!=0:
            k = int(str(y)[3])
            l = 9 - i
            m = 10-k
            print(g*100+l*10+m)


y = input()
x = f(int(y))

Buggy submission (verdict: Runtime Error):

def f(y):

    if 0 <= y <=999:
        print(1000-y)
    elif 1000<= y <= 10000 :
        b = int(y / 100)
        c = int(str(b)[1])
        g = 9-c
        h = int(y/10)
        i = int(str(h)[2])

        if y %1000==0:
            print("0")
        elif y % 500==0 and x % 1000!=0:
            print("500")
        elif y % 100==0 and x % 500!=0:
            f = 10-c
            print(f*100)
        elif y % 10 ==0 and x % 100!=0:
            j =10-i
            print(g*100+j*10)
        elif y % 10!=0:
            k = int(str(y)[3])
            l = 9 - i
            m = 10-k
            print(g*100+l*10+m)


y = input()
x = f(int(y))

Buggy submission (verdict: Runtime Error):

def f(y):

    if 0 <= y <=999:
        print(1000-y)
    else:
        b = int(y / 100)
        c = int(str(b)[1])
        g = 9-c
        h = int(y/10)
        i = int(str(h)[2])

        if y %1000==0:
            print("0")
        elif y % 500==0 and x % 1000!=0:
            print("500")
        elif y % 100==0 and x % 500!=0:
            f = 10-c
            print(f*100)
        elif y % 10 ==0 and x % 100!=0:
            j =10-i
            print(g*100+j*10)
        elif y % 10!=0:
            k = int(str(y)[3])
            l = 9 - i
            m = 10-k
            print(g*100+l*10+m)


y = input("number")

x = f(int(y))
Problem p03563 (python)

Fixed submission:
a =  float(raw_input())
c = float(raw_input())
print int(2*c-a)

Buggy submission (verdict: Runtime Error):
a =  float(raw_input())
c = float(raw_input())
print (2*c-a)

Buggy submission (verdict: Runtime Error):
import sys

a =  float(raw_input())
c = float(raw_input())
print 2*c-a

Buggy submission (verdict: Runtime Error):
a =  float(raw_input())
c = float(raw_input())
print 2*c-a