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

Fixed submission:
x,y=map(int,input().split())
if x%y==0:
    print(-1)
    exit()
print(x)

Buggy submission (verdict: Runtime Error):
N = int(input())
print(0)
now = input()
old = now
che = N//2+1
nowi = 0
print(nowi+che)
nowi = N//2+1
first = True
ische = (che%2==0)
for i in range(18):
    now = input()
    if now==old:
        if che%2==0:
            pass
        elif che%2==1:
            first = not first
    elif now!=old:
        if che%2==0:
            first = not first
        elif che%2==1:
            pass
        che-=che//2+1
        nowi = nowi+che
    if first:
        print(nowi+che)
        nowi+=che
    else:
        print(nowi-che)
        nowi-=che
    old = now
Problem p03469 (python)

Fixed submission:
s = list(input())
s[3]="8"
st=""
for c in s:
    st +=c
print(st)

Buggy submission (verdict: Runtime Error):
N,Y = map(int,input().split())
Y = Y/1000
torf = False
for numoft in range(N+1):
    for numof5t in range(N-numoft+1):
        numof10t = (N)-(numoft+numof5t)
        if Y == numoft + 5*numof5t + 10*numof10t:
            print(numof10t,numof5t,numoft)
            exit()
print("-1 -1 -1")
Problem p03471 (python)

Fixed submission:
N,Y = map(int,input().split())
Y = Y/1000
torf = False
for numoft in range(N+1):
    for numof5t in range(N-numoft+1):
        numof10t = (N)-(numoft+numof5t)
        if Y == numoft + 5*numof5t + 10*numof10t:
            print(numof10t,numof5t,numoft)
            exit()
print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
n,y=map(int,input().split())
for i in range(n-1):
  a10000=i+1
  for i2 in range(n-1-a10000):
    a5000=i2+1
    for i3 in range(n-1-a10000-a5000):
      a1000=i3+1
      if a10000*10000+a5000*5000+a1000*1000==y
        print(a10000,a5000,a1000)
        exit()
print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
n,y=map(int,input().split())
for i in range(n-1):
  a10000=i+1
  for i2 in range(n-1-a10000):
    a5000=i2+1
      for i3 in range(n-1-a10000-a5000):
        a1000=i3+1
        if a10000*10000+a5000*5000+a1000*1000==y:
          print(a10000,a5000,a1000)
          exit()
print("-1 -1 -1")
Problem p03475 (python)

Fixed submission:
N = int(input())
clis = [];slis =[];flis = []
for i in range(N-1):
    c,s,f = map(int,input().split())
    clis.append(c);slis.append(s);flis.append(f)
for i in range(N):
    count=0
    for i2 in range(N-i-1):
        c=clis[i+i2];s=slis[i+i2];f=flis[i+i2]
        if count <= s:
            count=s+c
        elif (count-s)%f ==0:
            count = count+c
        else:
            count = count + c+f-count%f
    print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
clis = [];slis =[];flis = []
for i in range(N-1):
    c,s,f = map(int,input().split())
    clis.append(c);slis.append(s);flis.append(f)
for i in range(N):
    count=0
    for i2 in range(N-i-1):
        c=clis[i+i2];s=slis[i+i2];f=flis[i+i2]
        if count <= s:
            count=s+c
        elif (count-s)%f ==0:
            count = count+c
        else:
            count = count + c f-count%f
    print(count)
Problem p03485 (python)

Fixed submission:
import math
a , b = map(float,input().split())
print(math.ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
s = input()
x,y=map(int,input().split())
fst = True;xory=1;xc=0;yc=0;xlis=[];ylis=[0];
for c in s:
    if c == "F":
        if xory == 1:
            xc +=1
        else:
            yc +=1
    else:
        if fst and xory ==1:
            xlis.append(xc)
            fst = False
            xory -=1
            xc = 0
        elif xory == 1:
            kari = xlis
            xlis =[i+xc for i in kari]
            xlis.extend([i-xc for i in kari])
            xc = 0
            xory -=1
        else:
            kari = ylis
            ylis = [i+yc for i in kari]
            ylis.extend([i-yc for i in kari])
            yc = 0
            xory +=1
if xory == 1:
    kari = xlis
    xlis =[i+xc for i in kari]
    xlis.extend([i-xc for i in kari])
    xc = 0
else:
    kari = ylis
    ylis = [i+yc for i in kari]
    ylis.extend([i-yc for i in kari])
    yc = 0

if x in xlis and y in ylis:
    print("Yes")
else:
    print("No")
Problem p03549 (python)

Fixed submission:
N ,M=map(float,input().split())
print(int((1900*M+100*(N-M))*2**M))

Buggy submission (verdict: Runtime Error):
N ,M=map(float,input().split())
print(int((1900*M+100*(N-M)*2**M))
Problem p03557 (python)

Fixed submission:
import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)

Buggy submission (verdict: Runtime Error):
import numpy as np
import bisect
a=int(raw_input())
Ali = np.array( map(int,raw_input().split()))
Bli =np.array(map(int,raw_input().split()))
Cli =np.array(map(int,raw_input().split()))
Ali = np.sort(Ali)
Cli = np.sort(Cli)[::-1]
co=0
for B in Bli:
    ca = bisect.bisect_left(Ali,B)
    cb =0
    for C in Cli:
        if C <= B:
            break
        else:
            cb +=1 
    co += ca*cb
print(co)
~
Problem p03573 (python)

Fixed submission:
a ,b ,c=map(int,raw_input().split())
if a==b:
  print(c)
elif a==c:
  print(b)
else:
  print(a)

Buggy submission (verdict: Runtime Error):
import numpy as np

H, W = map(int, input().split())
arr=np.array([])
s=0
while s != H:
  li=list(input())
  li=np.array(li)
  arr=np.hstack((arr,li))

  s+=1
arr=arr.reshape((H,W))
count=0
def check(x,y):
    global count
    if arr[x,y] == "#":
        count+=1

for x in range(H):
    stri=""
    for y in range(W):
        if arr[x,y] == ".":
            count=0
            top= None
            right =None
            left=None
            if y != 0:
                top=True
                check(x,(y-1))
            if x != 0:
                if top:
                    check((x-1),(y-1))
                check((x-1),y)
                left=True
            if x != (W-1):
                if top:
                    check((x+1),(y-1))
                right=True
                check((x+1),y)
            if y != (H-1):
                if left:
                    check(x-1,y+1)
                if right:
                    check(x+1,y+1)
                check(x,(y+1))
            print(str(count),end="")
        else:
            print("#",end="")
    print("")

Buggy submission (verdict: Runtime Error):
import numpy as np

H, W = map(int, raw_input().split())
arr=np.array([])
s=0
while s != H:
  li=list(raw_input())
  li=np.array(li)
  arr=np.hstack((arr,li))

  s+=1
arr=arr.reshape((H,W))
count=0

def check(x,y):
    import __main__
    if arr[x,y] == "#":
        __main__.count+=1

for x in range(H):
    stri=""
    for y in range(W):
        if arr[x,y] == ".":
            count=0
            top= None
            right =None
            left=None
            if y != 0:
                top=True
                check(x,(y-1))
            if x != 0:
                if top:
                    check((x-1),(y-1))
                check((x-1),y)
                left=True
            if x != (W-1):
                if top:
                    check((x+1),(y-1))
                right=True
                check((x+1),y)
            if y != (H-1):
                if left:
                    check(x-1,y+1)
                if right:
                    check(x+1,y+1)
                check(x,(y+1))
            stri=stri+str(count)
        else:
            stri=stri+"#"
    print(stri)
Problem p03773 (python)

Fixed submission:
a,b=map(int,input().split())
t=a+b
print(t if t < 24 else t-24)

Buggy submission (verdict: Runtime Error):
(t if t < 24 else t-24)
Problem p03777 (python)

Fixed submission:
a,b=input().split()
if a=="H":
  f=True
else:
  f=False
if f:
  print("H" if b=="H" else "D")
else:
  print("H" if b=="D" else "D")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if a=="H":
  f=True
else:
  f=False
if f:
  print("H" if b=="H" else "D")
else:
  print("H" if b=="D" else "D"
Problem p03844 (python)

Fixed submission:
A,op,B=input().split() 
if op=="+": 
    print(int(A)+int(B)) 
else: 
    print(int(A)-int(B))

Buggy submission (verdict: Runtime Error):
A,op,B=input.split() 
if op=="+": 
    print(int(A)+int(B)) 
else: 
    print(int(A)-int(B))
Problem p02732 (python)

Fixed submission:
def choose2(number):
	if number>=2:
		return (number*(number-1))/2
	else:
		return 0
N = int(input())
k = list(map(int,input().split()))
valArr = list(set(k))
occurence = []
occurenceIndex = []
mx = 0
for l in k:
	if l>mx:
		mx=l
for i in range(mx+1):
	occurence.append(0)
for j in range(N):
	occurence[k[j]]+=1
	
			
'''6*5/2
5*4/2
N*(N-1)/2
(N-2)*(N-1)/2
N*(N-1)/2*(N-2)/N
occurence = [1,2,3]
ans = 0+2*1/2+3*2/2
k val = 3
correct = 0+2*1/2+2*1/2

'''
ans = 0
for time in range(len(occurence)):
	ans+=choose2(occurence[time])
for ball in range(N):
	kans = ans-choose2(occurence[k[ball]])+choose2(occurence[k[ball]]-1)
	
	print(int(kans))

Buggy submission (verdict: Runtime Error):
def choose2(number):
	if number>=2:
		return (number*(number-1))/2
	else:
		return 0
N = int(input())
k = list(map(int,input().split()))
valArr = list(set(k))
occurence = []
occurenceIndex = []
for i in range(N):
	occurence.append(0)
for j in range(N):
	occurence[k[j]]+=1
	
			
'''6*5/2
5*4/2
N*(N-1)/2
(N-2)*(N-1)/2
N*(N-1)/2*(N-2)/N
occurence = [1,2,3]
ans = 0+2*1/2+3*2/2
k val = 3
correct = 0+2*1/2+2*1/2

'''
ans = 0
for time in range(len(occurence)):
	ans+=choose2(occurence[time])
for ball in range(N):
	kans = ans-choose2(occurence[k[ball]])+choose2(occurence[k[ball]]-1)
	
	print(int(kans))
Problem p02675 (python)

Fixed submission:
N = int(input())
 
if N % 10 == 3:
	print('bon')
elif N%10 == 0 or N%10 == 1 or N%10 == 6 or N%10 == 8:
	print('pon')
else: print('hon')

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) > K:
    new_S = S[:K]
    new_S += '...'
    print(new_S)
else:
    print(S)

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) > K:
	new_S = S[:K]
	new_S += '...'
    print(new_S)
else:
  print(S)

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

if N % 10 == 3:
	print('bon')
else if N%10 == 0 or N%10 == 1 or N%10 == 6 or N%10 == 8:
	print('pon')
else: print('hon')
Problem p04043 (python)

Fixed submission:
num = list(map(int,input().split()))
if num.count(5) == 2 and num.count(7) == 1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
num = [x for x in input().split() ]
count5 = num.count5("5")
count7 = num.count7("7")
if count5 == 2 and count7 == 1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
num = list.input()
count1 = num.count(5)
count2 = num.count(7)
if count1 == 2 and count2 == 7:
  print("YES")
else:
  print("NO")
Problem p03476 (python)

Fixed submission:
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import math


def generate_prime(p_max):
    prime = [2]
    for i in range(3, p_max + 1):
        for p in prime:
            if i % p == 0:
                break
            if p > math.sqrt(i):
                prime.append(i)
                break
    return prime


def main():
    prime = generate_prime(10**5)
    prime = set(prime)
    prime2 = set()
    for p in prime:
        if p == 2:
            continue
        if (p + 1) / 2 in prime:
            prime2.add(p)
    ans = [0] * (10**5 + 1)
    for i in range(1, 10**5 + 1):
        if i in prime2:
            ans[i] = ans[i - 1] + 1
        else:
            ans[i] = ans[i - 1]

    q = int(input())
    queries = [[int(i) for i in input().split()] for _ in range(q)]
    for query in queries:
        print(ans[query[1]] - ans[query[0] - 1])


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <climits>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;


const int N_MAX = 100001;
VI prime;
void generate_prime() {
    prime.push_back(2); 
    FOR(i, 3, N_MAX) {
        for(auto p : prime) {
            if(i % p == 0) break;
            if(p > sqrt(i)) {
                prime.push_back(i);
                break;
            }
        }
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    generate_prime();
    set<int> prime1(ALL(prime));
    set<int> prime2;
    for(auto& p : prime1) {
        if(p == 2) continue;
        if(prime1.count((p + 1) / 2) == 1) prime2.insert(p);
    }
    VI ans(N_MAX);
    ans[0] = 0;
    FOR(i, 1, N_MAX - 1) {
        if(prime2.count(i) == 1) ans[i] = ans[i - 1] + 1;
        else ans[i] = ans[i - 1];
    }
    
    int q;
    cin >> q;
    REP(i, q) {
        int l, r;
        cin >> l >> r;
        cout << ans[r] - ans[l - 1] << '\n';
    }
    return 0;
}
Problem p02677 (python)

Fixed submission:
#!/usr/bin/env python
# coding: UTF-8

import math, sys
if sys.version_info[0]<3: input=raw_input

class StandardInput:

    def stdin_string(self):
        self.s=str(input().rstrip())
        return self.s

    def stdin_integer(self):
        self.n=int(input().rstrip())
        return self.n

    def stdin_array(self):
        self.arr=input().rstrip().split()
        return self.arr

    def stdin_integer_array(self):
        self.arr=list(map(int,input().rstrip().split()))
        return self.arr

def test(arr):
    a,b,h,m=arr
    ar=2*math.pi*( h/12 + m/60/12 )
    br=2*math.pi*( m/60 )
    return math.sqrt( ( a*math.cos(ar) - b*math.cos(br) )**2 + ( a*math.sin(ar) - b*math.sin(br) )**2 )

def main():
    obj=StandardInput()
    arr=obj.stdin_integer_array()
    print(test(arr))
        
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# coding: UTF-8

import math, sys
if sys.version_info[0]<3: input=raw_input

class StandardInput:

    def stdin_string(self):
        self.s=str(input().rstrip())
        return self.s

    def stdin_integer(self):
        self.n=int(input().rstrip())
        return self.n

    def stdin_array(self):
        self.arr=input().rstrip().split()
        return self.arr

    def stdin_integer_array(self):
        self.arr=list(map(int,input().rstrip().split()))
        return self.arr

def test(arr):
    a,b,h,m=arr
    ar=2*math.pi*( h/12 + m/60/12 )
    br=2*math.pi*( m/60 )
    return math.sqrt( ( a*math.cos(ar) - b*math.cos(br) )**2 + ( a*math.sin(ar) - b*math.sin(br) )**2 )

def main():
    obj=StandardInput()
    arr=obj.stdin_integer_array()
    s=obj.stdin_string()
    print(test(arr))
        
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# coding: UTF-8

import math, sys
if sys.version_info[0]<3: input=raw_input

class StandardInput:

    def stdin_string(self):
        self.s=str(input().rstrip())
        return self.s

    def stdin_integer(self):
        self.n=int(input().rstrip())
        return self.n

    def stdin_array(self):
        self.arr=input().rstrip().split()
        return self.arr

    def stdin_integer_array(self):
        self.arr=list(map(int,input().rstrip().split()))
        return self.arr

def test(arr):
    a,b,h,m=arr
    ar=2*math.pi*( h/12 + m/60/12 )
    br=2*math.pi*( m/60 )
    return math.sqrt( ( a*math.cos(ar) - b*math.cos(br) )**2 + ( a*math.sin(ar) - b*math.sin(br) )**2 )

def main():
    obj=StandardInput()
    arr=obj.stdin_integer_array()
    s=obj.stdin_string()
    print(test(arr))
        
if __name__ == '__main__':
    main()
Problem p02850 (python)

Fixed submission:
from collections import deque

N = int(input())
edge = [set() for i in range(N+1)]
for i in range(N-1):
  a, b = map(int, input().split())
  edge[a].add((b, i))
  edge[b].add((a, i))

r = [0] * (N - 1)
q = deque([(0, 1)])

while q:
  preC, fromv = q.popleft()
  c = 0
  for tov, i in edge[fromv]:
    edge[tov].remove((fromv, i))
    c += 1 + (c + 1 == preC)
    q.append((c, tov))
    r[i] = c
print(max(r))
for x in r:
  print(x)

Buggy submission (verdict: Runtime Error):
N = int(input())
ab = [tuple(map(int, input().split())) for i in range(N-1)]

abd = {}
for a, b in ab:
  abd[a] = abd.get(a,set())
  abd[a].add(len(abd[a]) + 1)
  
  abd[b] = abd.get(b,set())
  abd[b].add(len(abd[b]) + 1)

rk = max([len(x) for x in abd.values()])
print(rk)

for a, b in ab:
  c = abd[a].pop()
  abd[b].remove(c)
  print(c)
Problem p02853 (python)

Fixed submission:
X, Y = map(int, input().split())
r = 0
if(X == 1):
  r += 300000
elif(X == 2):
  r += 200000
elif(X == 3):
  r += 100000
else:
  pass

if(Y == 1):
  r += 300000
elif(Y == 2):
  r += 200000
elif(Y == 3):
  r += 100000
else:
  pass

if(X == Y == 1):
  r += 400000

print(r)

Buggy submission (verdict: Runtime Error):
M = int(input())
CD = C = 0
for i in range(M):
  d, c = map(int, input().split())
  CD += c * d
  C += c
print(C - 1 + (CD - 1) // 9)
Problem p03074 (python)

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

def runLength(s):
  if len(s) == 0: return []
  if len(s) == 1: return [(s, 1)]
  res = []
  lc = 1
  for i in range(1, len(s)):
    if s[i-1] == s[i]:
      lc += 1
    else:
      res.append((s[i-1], lc))
      lc = 1
  res.append((s[i], lc))
  return res

S = runLength(input())
accsum = [0] * (1 + (S[0][0] == "0"))
for i in range(len(S)):
  accsum.append(accsum[-1] + S[i][1])
if S[-1][0] == "0":
  accsum.append(accsum[-1])
print(max([accsum[i] - accsum[i-2*K-1] for i in range(2*K+1, len(accsum), 2)]) if len(accsum) > 2*K+2 else N)

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

def runLength(s):
  if len(s) == 0: return []
  if len(s) == 1: return [(s, 1)]
  res = []
  lc = 1
  for i in range(1, len(s)):
    if s[i-1] == s[i]:
      lc += 1
    else:
      res.append((s[i-1], lc))
      lc = 1
  res.append((s[i], lc))
  return res

S = runLength(input())
accsum = [0] * (1 + (S[0][0] == "0"))
for i in range(len(S)):
  accsum.append(accsum[-1] + S[i][1])
if S[-1][0] == "0":
  accsum.append(accsum[-1])
print(max([accsum[i] - accsum[i-2*K-1] for i in range(2*K+1, len(accsum), 2)]) if N >= 2*K else N)
Problem p03166 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**5) 

N, M = map(int, input().split())
edge = [[] for i in range(N)]
for i in range(M):
  x, y = map(int, input().split())
  edge[x-1].append(y-1)

dp = [-1] * N
def dist(v):
  if dp[v] != -1: return dp[v]
  
  res = 0
  for to in edge[v]:
    res = max(res, dist(to) + 1)
  
  dp[v] = res
  return res

ans = 0
for i in range(N):
  ans = max(ans, dist(i))

print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
edge = [[] for i in range(N)]
for i in range(M):
  x, y = map(int, input().split())
  edge[x-1].append(y-1)

dp = [-1] * N
def dist(v):
  if dp[v] != -1: return dp[v]
  
  res = 0
  for to in edge[v]:
    res = max(res, dist(to) + 1)
  
  dp[v] = res
  return res

ans = 0
for i in range(N):
  ans = max(ans, dist(i))

print(ans)
Problem p03169 (python)

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

S = [0] * 3
for a in A:
  S[a-1] += 1
I, J, K = S

dp = [[[0.0] * (N+1) for j in range(N+1)] for i in range(N+1)]

for k in range(S[2] + 1):
  for j in range(S[1] + S[2] - k + 1):
    for i in range(S[0] + S[1] + S[2] - j - k + 1):
      if i == j == k == 0: continue
      dp[i][j][k] = (i * (dp[i-1][j][k] if i > 0 else 0) + j * (dp[i+1][j-1][k] if j > 0 else 0) + k * (dp[i][j+1][k-1] if k > 0 else 0) + N) / (i + j + k)

print(dp[I][J][K])

Buggy submission (verdict: Runtime Error):
from functools import lru_cache

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

S = [0] * 3
for a in A:
  S[a-1] += 1

@lru_cache(maxsize=None)
def calc(i, j, k):
  if i==j==k==0: return 0
  return (i * (calc(i-1, j, k) if i > 0 else 0) + j * (calc(i+1, j-1, k) if j > 0 else 0) + k * (calc(i, j+1, k-1) if k > 0 else 0) + N) / (i + j + k)

print(calc(*S))
Problem p03288 (python)

Fixed submission:
r = int(input())
print("ABC" if r<1200 else "ARC" if r<2800 else "AGC")

Buggy submission (verdict: Runtime Error):
r = int(input());print("ABC"if r<1200else"ARC"if else r<2800else"AGC")
Problem p03523 (python)

Fixed submission:
import re
print("YES" if re.match("^A?KIHA?BA?RA?$", input()) else "NO")

Buggy submission (verdict: Runtime Error):
s = list(input())
if(len(s) > 9):
  print("NO")
  exit()

ans = "AKIHABARA"
i = 0

while(i < len(ans) and len(s) <= len(ans)):
  if("".join(s) == ans):
    print("YES")
    exit()
  
  if(i == len(ans) - 1 or s[i] != ans[i]):
    s.insert(i, "A")
  else:
    i += 1

print("NO")

Buggy submission (verdict: Runtime Error):
s = list(input())
if(len(s) > 10):
  print("NO")
  exit()

ans = "AKIHABARA"
i = 0

while(i < len(ans) and len(s) <= len(ans)):
  if("".join(s) == ans):
    print("YES")
    exit()
  
  if(i == len(ans) - 1 or s[i] != ans[i]):
    s.insert(i, "A")
  else:
    i += 1

print("NO")
Problem p03597 (python)

Fixed submission:
print(int(input())**2-int(input()))

Buggy submission (verdict: Runtime Error):
n,a=map(int,input().split())
print(n*n-a)
Problem p03721 (python)

Fixed submission:
import heapq
n, k = map(int,input().split())
hq = []
for i in range(n):
  heapq.heappush(hq, tuple(map(int, input().split())))
length = 0
while(length < k):
  a, b = heapq.heappop(hq)
  length += b
print(a)

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
result = float("Inf")
length = 0
for i in range(N):
  a, b = map(int,input().split())
  if(length < k):
    length += b
    result = max(result, a)
  else:
    if(a < result):
      length += b
      if(length > k):
        result = a
print(result)
Problem p02705 (python)

Fixed submission:
r = int(input())

print(r*2*3.141592)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
a = int(a)
c = []

c = input().split()

for i in range(int(b)):
	a-=int(c[i])

if(a>=0):
		print (a)
else:
	print("-1")
Problem p02675 (python)

Fixed submission:
s = input()
a = s[len(s)-1]

if a == "2" or a == "4" or a == "5" or a == "7" or a == "9":
    print("hon")
elif a == "0" or a == "1" or a == "6" or a == "8":
    print("pon")
else:
    print("bon")

Buggy submission (verdict: Runtime Error):
s = input()
a = s[len(s)-1]

if a == "2" or a == "4" or a == "5" or a == "7" or a == "9":
    print("hon)
elif a == "0" or a == "1" or a == "6" or a == "8":
    print("pon")
else:
    print("bon")