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

Fixed submission:
N, M = (int(i) for i in input().split())
hoge = {i + 1 for i  in range(M)}

for i in range(N):
    likes = set()
    on = input().split()
    on.pop(0)
    likes = {int(j) for j in on}
    hoge &= likes


c = len(hoge)

print(c)

Buggy submission (verdict: Runtime Error):
N, M = (int(i) for i in input().split())
hoge = {i for i + 1 in range(M)}
for i in range(N):
    likes[i] = set()
    likes[i] = {i for i in input().split()}
    hoge &= likes[i]

c = len(hoge)

print(hoge)

Buggy submission (verdict: Runtime Error):
N, M = (int(i) for i in input().split())
hoge = set((int(i) for i + 1 in range(M)))
for i in range(N):
    likes[i] = set()
    likes[i].add((int(i) for i in input().split()))
    hoge &= likes[i]

c = len(hoge)

print(hoge)
Problem p02963 (python)

Fixed submission:
import math
S = int(input())

hoge = math.sqrt(S)
hoge = math.ceil(hoge)
onon = hoge ** 2 - S
hogehoge = onon
hogehoge2 = 1
for i in range(2, 10*9):
    if onon % i == 0:
        hogehoge = onon // i
        hogehoge2 = i
        break

print("0 0 " + str(hogehoge) + " " + str(hoge) + " " + str(hoge) + " " + str(hogehoge2))

Buggy submission (verdict: Runtime Error):
import math
S = int(input())

hoge = math.sqrt(S)
hoge = math.ceil(hoge)
onon = hoge ** 2 - S
for i in range(2, 10*9):
    if onon % i == 0:
        hogehoge = onon // i
        hogehoge2 = i
        break

print("0 0 " + str(i) + " " + str(hoge) + " " + str(hoge) + " " + str(hogehoge2))
Problem p02973 (python)

Fixed submission:
import bisect

N = input()
N = int(N)
S = [-int(input()) for _ in range(N)]
result = []

for i in range(N):
    hoge = bisect.bisect(result,S[i])
    if hoge == len(result):
        result.append(S[i])
    else:
        result[hoge] = S[i]
print(len(result))

Buggy submission (verdict: Runtime Error):
import bisect

N = input()
N = int(N)
S = [int(input()) for _ in range(N)]
result = []

for i in range(N):
    hoge = bisect.bisect_left(result,S[i])
    if hoge == 0:
        result = S[i] + result
    else:
        result[hoge - 1] = hoge
print(len(result))

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)
S = [int(input()) for _ in range(N)]
result = 0

while onon < N:
    result += 1
    hoge = S.pop(0)
    onon = 0
    for j in range(len(S)):
        if S[onon] > hoge:
            S.pop(onon)
        else:
            onon + 1
print(result)
Problem p02993 (python)

Fixed submission:
S = input()
S = list(S)
S.append("a")
hoge = "Good"
for i in range(4):
    if S[i] == S[i + 1]:
        hoge = "Bad"

print(hoge)

Buggy submission (verdict: Runtime Error):
S = input()
S = list(S)
S.append("a")
hoge = "Good"
for i in range(4):
    if hoge[i] == hoge[i + 1]:
        hoge = "Bad"

print(hoge)
Problem p02996 (python)

Fixed submission:
N = input()
N = int(N)
s = [[ int(i) for i in input().split()] for i in range(N)]
time = 0
hoge = "Yes"
s = sorted(s, key=lambda s:s[1])
for i in s:
    time += i[0]
    if time > i[1]:
        hoge = "No" 
        break

print(hoge)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)
s = [[ int(i) for i in input().split()] for i in range(N)]
hoge = "True"
s = sorted(s, key=lambda s:s[1])
for i in s:
    time += s[0]
    if time > s[1]:
        hoge = "No" 
        break

print(hoge)
Problem p03000 (python)

Fixed submission:
N,X = (int(i) for i in input().split())
L = [int(i) for i in input().split()] 
result = 0
D = 0
for i in range(N + 1):
    if D <= X:
        result += 1
    if i != N:
        D += L[i]
print(result)

Buggy submission (verdict: Runtime Error):
N,x = (int(i) for i in input().split())
L = [int(i) for i in input().split()] 
result = 0
D = 0
for i in range(N + 1):
    if D <= X:
        result += 1
    if i != N:
        D += L[i]
print(result)

Buggy submission (verdict: Runtime Error):
N,x = (int(i) for i in input().split())
L = [int(i) for i in input().split()] 
result = 0
D = 0
for i in range(N + 1):
    if D <= X:
        result += 1
    D += L[i]
print(result)
Problem p03001 (python)

Fixed submission:
W,H,x,y = (int(i) for i in input().split())
hoge = 0
if W / 2 == x and H / 2 == y and H > 0 and W > 0:
    hoge = 1

print(str(W*H/2) +" " + str(hoge))

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)
s = [[ int(i) for i in input().split()] for i in range(N)]
W = [int(i) for i in input().split()] 


W,H,x,y = (int(i) for i in input().split())
hoge = 0
if W//2 == x and H // 2 == y:
    hoge = 1

print(str(W*H//2) +" " + str(hoge))
Problem p03005 (python)

Fixed submission:
N, K = map(int, input().split())
if K >= 2:
    print(N - K)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
if N >= 2:
    print(N - K)
elif:
    print(0)
Problem p03006 (python)

Fixed submission:
N = input()
N = int(N)
s = [[ int(i) for i in input().split()] for i in range(N)]
hoge = []
import collections

for i in s:
    for k in s:
        if k != i:
            hoge1 = (i[0] - k[0],i[1] - k[1])
            if hoge1[0] <= 0:
                hoge1 = (k[0] - i[0],k[1] - i[1])
            if hoge1[0] == 0 and hoge1[1] <= 0:
                hoge1 = (k[0] - i[0],i[1] - k[1])
            hoge.append(hoge1)
if len(hoge) >= 1:
	c = collections.Counter(hoge)
	print(N - c.most_common()[0][1] // 2)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)
s = [[ int(i) for i in input().split()] for i in range(N)]
hoge = []
import collections

for i in s:
    for k in s:
        if k != i:
            hoge1 = (i[0] - k[0],i[1] - k[1])
            if hoge1[0] < 0:
                hoge1 = (k[0] - i[0],k[1] - i[1])
            hoge.append(hoge1)

c = collections.Counter(hoge)

print(N - c.most_common()[0][1] // 2)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)
s = [[ int(i) for i in input().split()] for i in range(N)]
hoge = []
import collections

for i in s:
    for k in s:
        if k != i:
            hoge1 = (i[0] - k[0],i[1] - k[1])
            if hoge1[0] < 0:
                hoge1 = hoge1 * -1
            hoge.append(hoge1)

c = collections.Counter(hoge)
print(N - c.most_common()[0][1] // 2)
Problem p03037 (python)

Fixed submission:
N,M = (int(i) for i in input().split())
e = [[int(i) for i in input().split()] for i in range(M)]

right = N
left = 0

for i in e:
    if left < i[0]:
        left = i[0]
    if right > i[1]:
        right = i[1]
if right >= left:
    print(right - left + 1)
else:
    print("0")

Buggy submission (verdict: Runtime Error):
N,M = (int(i) for i in input().split())
e = [[int(i) for i in input().split()] for i in range(M)]
hoge = set()

zenbu = {int(i + 1) for i in range(N)}

for i in e:
    konkaino = {int(i) for i in range(e[0],e[1] + 1)}
    zenbu = zenbu & konkaino


print(len(zenbu))
Problem p03049 (python)

Fixed submission:
N = int(input())
s = []

result = 0
ABAB = 0
A = 0
B = 0
onon = 0

amari = 0
for i in range(N):
    s.append(input())

for S in s:
    AB = S.count("AB")
    result += AB
    if S[0] == "B" and S[-1] == "A":
        ABAB += 1
    elif S[0] == "B":
        B += 1
    elif S[-1] == "A":
        A += 1

if ABAB >= 1:
    onon = onon + ABAB - 1

if A >= 1 and ABAB >= 1 :
    onon += 1
    A -= 1
if B >= 1 and ABAB >= 1 :
    onon += 1
    B -= 1

if A >= 1 and B >= 1:
    if A >= B:
        onon += B
    else:
        onon += A


print(result + onon)

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

result = 0
ABAB = 0
A = 0
B = 0

amari = 0
for i in range(N):
    s.append(input())

for S in s:
    AB = S.count("AB")
    result += AB
    if S[0] == "B" and S[-1] == "A":
        ABAB += 1
    elif S[0] == "B":
        B += 1
    elif S[-1] == "A":
        A += 1




if ABAB >= 1:
    onon = onon + ABAB - 1

if A >= 1:
    onon += 1
if B >= 1:
    onon += 1



print(result + onon)

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

result = 0
ABAB = 0
A = 0
B = 0

amari = 0
for i in range(N):
    s.append(input())

for S in s:
    AB = S.count("AB")
    result += AB
    if S[0] == "B" and S[-1] == "A":
        ABAB += 1
    elif S[0] == "B":
        B += 1
    else S[-1] == "A":
        A += 1


if A >= B:
    onon = B
    amari = A - B
else:
    onon = A
    amari = B - A

if ABAB >= 1:
    onon = onon + ABAB - 1

if amari >= 1:
    onon = onon + 1

print(result + onon)
Problem p03069 (python)

Fixed submission:
N = int(input())
S = input()
 
result = min(S.count("."),S.count("#"))
leftblack = 0
rightwhite = S.count(".")
 
for i in range(N):
    if(S[i] == "."):
        rightwhite -= 1
    else:
        leftblack += 1
    if result >= leftblack + rightwhite:
        result = leftblack + rightwhite
 
print(result)

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

result = min(S.count("."),S.count("#"))
i = 0

while i < N:
    leftslice = S[:i]
    rughtslice = S[i:]
    leftblack = leftslice.count("#")
    rightwhite = rightslice.count(".")
    nowresult = leftblack + rightwhite
    if result >= nowresult:
        result = nowresult
    else:
        i += (nowresult - result)
    i += 1

print(result)

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

result = min(S.count("."),S.count("#"))
i = 0

while i < N:
    leftslice = S[:i]
    rughtslice = S[i:]
    print(leftslice)
    print(rightslice)
    leftblack = leftslice.count("#")
    rightwhite = rightslice.count(".")
    nowresult = leftblack + rightwhite
    if result >= nowresult:
        result = nowresult
    else:
        i += (nowresult - result)
    i += 1

print(result)

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

result = min(S.count("."),S.count("#"))

for i in range(N):
    leftslice = S[:i]
    rightslice = S[i:]
    print(leftslice)
    print(rightslice)
    leftblack = leftslice.count("#")
    rightwhite = rightslice.count(".")
    if result >= leftblack + rightwhite:
        result = leftblack + rightwhite

print(result)
Problem p03095 (python)

Fixed submission:
N = input()
s = input()
hoge = []
charlist = list(s)
result = 1
Alist = ["q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m"]
for i in Alist:
    hoge.append(charlist.count(i))
for j in hoge:
    result = result * (j + 1)
print((result -1) % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
N = input()
s = input()
hoge = []
charlist = list(s)
result = 1
Alist = ["q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m"]
for i in Alist:
    hoge.append(charlist.count(i))
for j in hoge:
    result = result * (j + 1)
print((result -1) ¥ (10 ** 9 + 7))
Problem p03059 (python)

Fixed submission:
n=input().split(" ")
A=int(n[0])
B=int(n[1])
T=int(n[2])
 
bis=int((T+0.5)/A)*B
print(bis)

Buggy submission (verdict: Runtime Error):
n=int(input()).split(" ")
A=n[0]
B=n[1]
T=n[2]

bis=int((T+0.5)/A)*B
Problem p03219 (python)

Fixed submission:
x, y = list(map(int, input().split()))
print(x+y//2)

Buggy submission (verdict: Runtime Error):
x, y = list(map(input().split(), int))
print(x + y//2)
Problem p03220 (python)

Fixed submission:
N=int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))
temp = [abs(1000*T - 6*x - 1000*A) for x in H]
m = min(temp)
i = temp.index(m)
print(i+1)

Buggy submission (verdict: Runtime Error):
ソースコード
N=int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))
temp = [abs(1000*T - 6*x - 1000*A) for x in H]
m = min(temp)
i = temp.index(m)
print(i+1)
Problem p03282 (python)

Fixed submission:
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

def test(x):
  return x % 2 == 1 and sum(x % y == 0 for y in range(1, x+1)) == 8

S = input()
K = read() - 1
N = len(S)
i0 = next((i for i in range(N) if S[i] != '1'), N)
if K < i0:
  print(1)
else:
  print(S[i0])

Buggy submission (verdict: Runtime Error):
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

def test(x):
  return x % 2 == 1 and sum(x % y == 0 for y in range(1, x+1)) == 8

S = input()
K = read() - 1
i0 = next(i for i in range(len(S)) if S[i] != '1')
if K < i0:
  print(1)
else:
  print(S[i0])
Problem p03559 (python)

Fixed submission:
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import *

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

N = read()
A = sorted(reads())
B = sorted(reads())
C = sorted(reads())

numB = [0] * N
for i in range(N):
  numB[i] = N - bisect_left(C, B[i]+1)
print(numB, file=stderr)

anumB = [0] * (N+1)
for i in range(N):
  anumB[i+1] = anumB[i] + numB[i]
print(anumB, file=stderr)

numA = [0] * N
for i in range(N):
  numA[i] = anumB[N] - anumB[bisect_left(B, A[i]+1)]
print(numA, file=stderr)

print(sum(numA))

Buggy submission (verdict: Runtime Error):
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import *

import numpy as np

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

N = read()
A = sorted(reads())
B = sorted(reads())
C = sorted(reads())

numB = [0] * N
for i in range(N):
  numB[i] = N - bisect_left(C, B[i]+1)
print(numB, file=stderr)

anumB = [0] * (N+1)
for i in range(N):
  anumB[i+1] = anumB[i] + numB[i]
print(anumB, file=stderr)

numA = [0] * N
for i in range(N):
  numA[i] = anumB[N] - anumB[bisect_left(B, A[i]+1)]
print(numA, file=stderr)

print(sum(numA))
Problem p03601 (python)

Fixed submission:
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *
from heapq import *

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

maxd = -1
ans = None

A, B, C, D, E, F = reads()
for i, j, k in product(range(31), range(31), range(3001)):
  water100 = A * i + B * j
  if C * k > water100 * E or C * k > F - water100 * 100 or water100 == 0:
    continue
  l = min(water100 * E - C * k, F - water100 * 100 - C * k) // D
  sugar = C * k + D * l
  mass = water100 * 100 + sugar
  density = sugar / mass
  if mass <= F and maxd < density:
    maxd = density
    ans = (mass, sugar)

print(ans[0], ans[1])

Buggy submission (verdict: Runtime Error):
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *
from heapq import *

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

maxd = -1
ans = None

A, B, C, D, E, F = reads()
for i, j, k in product(range(31), range(31), range(3001)):
  water100 = A * i + B * j
  if C * k > water100 * E or water100 == 0:
    continue
  l = (water100 * E - C * k) // D
  sugar = C * k + D * l
  mass = water100 * 100 + sugar
  density = sugar / mass
  if mass <= F and maxd < density:
    maxd = density
    ans = (mass, sugar)

print(ans[0], ans[1])

Buggy submission (verdict: Runtime Error):
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *
from heapq import *

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

maxd = 0
ans = None

A, B, C, D, E, F = reads()
for i, j, k in product(range(31), range(31), range(3001)):
  water100 = A * i + B * j
  if C * k > water100 * E or water100 == 0:
    continue
  l = (water100 * E - C * k) // D
  sugar = C * k + D * l
  mass = water100 * 100 + sugar
  density = sugar / mass
  if mass <= F and maxd < density:
    maxd = density
    ans = (mass, sugar)

print(ans[0], ans[1])
Problem p03662 (python)

Fixed submission:
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

setrecursionlimit(1 << 30)

N = read()
edges = [[] for _ in range(N)]
for _ in range(N-1):
  a, b = reads()
  a, b = a-1, b-1
  edges[a].append(b)
  edges[b].append(a)

def dist(u, d):
  for v in edges[u]:
    if d[v] >= 0:
      continue
    d[v] = d[u] + 1
    dist(v, d)
  return d

distf = dist(0, [0]+[-1]*(N-1))
dists = dist(N-1, [-1]*(N-1)+[0])

numf = sum(distf[i] <= dists[i] for i in range(N))
nums = N - numf

if numf > nums:
  print("Fennec")
else:
  print("Snuke")

Buggy submission (verdict: Runtime Error):
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

N = read()
edges = [[] for _ in range(N)]
for _ in range(N-1):
  a, b = reads()
  a, b = a-1, b-1
  edges[a].append(b)
  edges[b].append(a)

def dist(u, d = None):
  if d == None:
    d = [-1] * N
  for v in edges[u]:
    if d[v] >= 0:
      continue
    d[v] = d[u] + 1
    dist(v, d)
  return d

distf = dist(0)
dists = dist(N-1)

numf = sum(distf[i] >= dists[i] for i in range(N))
nums = N - numf

if numf >= nums:
  print("Fennec")
else:
  print("Snuke")
Problem p03995 (python)

Fixed submission:
from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

setrecursionlimit(1000000)

(R, C) = reads()
N = read()

d = defaultdict(list)
V = set()

for _ in range(N):
  (r, c, a) = reads()
  (r, c) = (r-1, c-1)
  d["R", r].append((("C", c), a))
  d["C", c].append((("R", r), a))
  V.add(("R", r))
  V.add(("C", c))

def walk(v):
  V.discard(v)
  for (w, a) in d[v]:
    wcol = a - col[v]
    if w in col:
      if col[w] != wcol:
        print("No"); exit()
    else:
      col[w] = wcol
      walk(w)

while len(V) > 0:
  v = V.pop()
  col = dict()
  col[v] = 0
  walk(v)
  rcol = min(a for (v, a) in col.items() if v[0] == "R")
  ccol = min(a for (v, a) in col.items() if v[0] == "C")
  if rcol + ccol < 0:
    print("No"); exit()

print("Yes")

Buggy submission (verdict: Runtime Error):
from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

setrecursionlimit(10000)

(R, C) = reads()
N = read()

d = defaultdict(list)
V = set()

for _ in range(N):
  (r, c, a) = reads()
  d["R", r-1].append((("C", c-1), a))
  d["C", c-1].append((("R", r-1), a))
  V.add(("R", r-1))
  V.add(("C", c-1))

def walk(v):
  for (w, a) in d[v]:
    wcol = a - col[v]
    if w in col:
      if col[w] != wcol:
        print("No"); exit()
    else:
      col[w] = wcol
      V.remove(w)
      walk(w)

while len(V) > 0:
  col = dict()
  v = V.pop()
  col[v] = 0
  walk(v)
  rcol = min(a for (v, a) in col.items() if v[0] == "R")
  ccol = min(a for (v, a) in col.items() if v[0] == "C")
  if rcol + ccol < 0:
    print("No"); exit()

print("Yes")
Problem p04015 (python)

Fixed submission:
from sys import exit

def reads():
  return [int(x) for x in input().split()]

(N, A) = reads()
x = reads()

d = dict()

d[0] = 1

for i in range(N):
  for (s, N) in list(d.items()):
    k = s + x[i] - A
    d[k] = d.get(k, 0) + N

print(d[0]-1)

Buggy submission (verdict: Runtime Error):
from sys import exit

def reads():
  return [int(x) for x in input().split()]

(N, A) = reads()
x = reads()

assert(N <= 16)

count = 0

for b in range(1, 1<<N):
  bits = [bool(b&(1 << i)) for i in range(N)]
  if sum(x[i] for i in range(N) if bits[i]) == A * sum(bits):
    count += 1
    # print(bits)

print(count)
Problem p02993 (python)

Fixed submission:
num=input()
c=False
for i in range(1,len(num)):
  if num[i]==num[i-1]:
    c=True
    
if c==True:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
num=input()
c=False
for i in range(1,len(num)+1):
  if num[i]==num[i-1]:
    c=True
    
if c==True:
  print("Bad")
else:
  print("Good")
Problem p02999 (python)

Fixed submission:
X,A=map(int,input().split())
print(10*(A<=X))

Buggy submission (verdict: Runtime Error):
X,A=map(int,input().split())
print(10*(A=<X))
Problem p03071 (python)

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

total = 0

if a >= b :
    total = a
    a -= 1
else:
    total = b
    b -=  1

if a>= b :
    total = total + a
else:
    total = total + b

print(total)

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

total = 0
maxN = 0
for num in h:
  if  num >= maxN:
    total += 1
  
  maxN = max(maxN,num)

print(total)

Buggy submission (verdict: Runtime Error):
number = input()

height = list(map(int,input().split()))

total = 1
flag = True
    
for i in range(1,len(height)):

    for j in range(i):
        if height[i] >= height[j]:
            flag = True
        else:
            flag = False
    
    if flag:
        total += 1

print(total)

Buggy submission (verdict: Runtime Error):
number = input()

height = list(map(int,input().split()))

total = 1
flag = True
    
for i in range(1,len(height)):

    for j in range(i):
        if height[i] >= height[j]:
            flag = True
        else:
            flag = False
    
    if flag:
        total += 1

print(total)
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3*r**2)

Buggy submission (verdict: Runtime Error):
read r
echo $((3*r*r))

Buggy submission (verdict: Runtime Error):
read r
echo $((3**r*r))
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
if a*b % 2==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a=int(input())
tl=[]
xl=[]
yl=[]
for i in range(a):
  t,x,y=map(int,input().split())
  tl.append(t)
  xl.append(x)
  yl.append(y)

#print(tl)
for i range(a):
  if (xl[i]+yl[i] > tl[i]):
    print("No")
    exit()
print("Yes")
Problem p02971 (python)

Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]
m1,m2,*_ = sorted(A)[::-1]

for i in A:
    if m1 == i:
        print(m2)
    else:
        print(m1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for _ in range(N)]
m1,m2,_ = sorted(A)[::-1]

for i in A:
    if m1 == i:
        print(m2)
    else:
        print(m1)
Problem p03078 (python)

Fixed submission:
def main():
	x, y, z, k = map(int, input().split())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = list(map(int, input().split()))
	d = [0]*x*y
	for i in range(x):
		for j in range(y):
			d[i*y+j] = a[i]+b[j]
	d.sort(reverse=True)
	c.sort(reverse=True)

	c_len = min(k, z)
	d_len = min(k, x*y)
	e = [0]*d_len*c_len
	for i in range(d_len):
		for j in range(c_len):
			e[i*c_len+j] = d[i] + c[j]
	e.sort(reverse=True)
	for i in range(k):
		print(e[i])


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
	sys.setrecursionlimit(10**9)
	x, y, z, k = map(int, input().split())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = list(map(int, input().split()))
	d = [0]*x*y*z
	for i in range(x):
		for j in range(y):
			for l in range(z):
				d[i*y*z+j*z+l] = a[i]+b[j]+c[l]
	d.sort(reverse=True)
	for i in range(k):
		print(d[i])


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import heapq

def main():
	x, y, z, k = map(int, input().split())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = list(map(int, input().split()))
	d = [0]*x*y*z
	for i in range(x):
		for j in range(y):
			for l in range(z):
				d[i*y*z+j*z+l] = a[i]+b[j]+c[l]
	d.sort(reverse=True)
	for i in range(k):
		print(d[i])


if __name__ == '__main__':
    main()