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

Fixed submission:
N,K=map(int,input().split())
B=[0]*N
for i in map(int,input().split()):B[~-i]+=1
print(sum(sorted(B)[:-K]))

Buggy submission (verdict: Runtime Error):
#include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < n; ++i)
using namespace std;

int main() {
  int N, K;
	cin >> N >> K;
  vector<int> c(N);
	REP(i,N) {
		int a; cin >> a; c[--a]++;
	}
	sort(c.begin(), c.end(), greater<int>());
	int s = N;
	REP(i,K) s -= c[i];
	cout << s << endl;
	return 0;
}
Problem p03607 (python)

Fixed submission:
numbers = {}
for _ in [0] * int(input()):
    A = int(input())
    numbers[A] = numbers.get(A, 0) ^ 1
print(sum(numbers.values()))

Buggy submission (verdict: Runtime Error):
numbers = set()
for _ in [0] * int(input()):
    A = int(input())
    if A in numbers:
        arr.remove(A)
    else:
        arr.add(A)
print(len(numbers))
Problem p03623 (python)

Fixed submission:
x,a,b=map(int,input().split())
print('AB'[abs(a-x)>abs(b-x)])

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input())
print('AB'[abs(a-x)>abs(b-x)])
Problem p03633 (python)

Fixed submission:
import fractions
import functools
lcm=lambda x,y:x*y//fractions.gcd(x,y)
print(functools.reduce(lcm,[int(input())for _ in[0]*int(input())]))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    while b:
        a, b = b, a % b
    return b

ans = 1
for _ in range(int(input())):
    t = int(input())
    ans = ans * t // gcd(ans, t)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
import functools
lcm=lambda x,y:x*y//math.gcd(x,y)
print(functools.reduce(lcm,[int(input())for _ in[0]*int(input())]))
Problem p03687 (python)

Fixed submission:
S = input()
ans = len(S)
for tgt in set(S):
    T = S
    while len(T) != T.count(tgt):
        U = ''
        for ab in zip(T, T[1:]):
            U += tgt if tgt in ab else ab[0]
        T = U
    ans = min(ans, len(S) - len(T))
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
ans = min(max(map(len, S.split(c)))
          for c in [chr(i + 97) for i in range(26)]
          if c not in S)
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
ans = min(max(map(len, S.split(c)))
          for c in [chr(i + 97) for i in range(26)]
          if c not in S))
print(ans)
Problem p03730 (python)

Fixed submission:
A, B, C = map(int, input().split())
r = [(A * k) % B for k in range(B)]
print(["NO", "YES"][C in r])

Buggy submission (verdict: Runtime Error):
import math
*S, C = map(int, input().split())
print(["NO", "YES"][C % math.gcd(*S) == 0])
Problem p03944 (python)

Fixed submission:
e,n,N = map(int,input().split())
w=s=0
for _ in[0]*N:
    x,y,a = map(int,input().split())
    if a == 1:
        w = max(w,x)
    elif a == 2:
        e = min(e,x)
    elif a == 3:
        s = max(s,y)
    else:
        n = min(n,y)
print((e-w)*(n-s)*(e>w)*(n>s))

Buggy submission (verdict: Runtime Error):
W,H,N = map(int,input().split())
w=h=0
for _ in[0]*N:
    x,y,a = map(int,input().split())
    if a == 1:
        w = max(w,x)
    elif a == 2:
        W = min(W,x)
    elif a == 3:
        h = max(h,y)
    elhe:
        H = min(H,y)
print((W-w)*(H-h)*(W>w)*(H>h))
Problem p03244 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
a = [0 for i in range(10**6)]
b = [0 for i in range(10**6)]
a_i = 0
b_i = 0
i = 0
for e in l:
    if i%2 == 0:
        a[e]+=1
        if(a[a_i]<=a[e]):
            a_i=e
    else:
        b[e]+=1
        if(b[b_i]<=b[e]):
            b_i=e
    i+=1
a.sort()
a.reverse()
b.sort()
b.reverse()
if a_i != b_i:
    print(n-a[0]-b[0])
else:
    print(n-max(a[0]+b[1],a[1]+b[0]))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
a = [0 for i in range(n)]
b = a
a_i = 0
b_i = 0
for i in l:
  if i%2 == 0:
    a[i]+=1
    if(a[a_i]<=a[i]):
      a_i=i
  else:
    b[i]+=1
    if(b[b_i]<=b[i]):
      b_i=i
a.sort()
a.reverse()
b.sort()
b.reverse()
if a_i == b_i:
  print(n-a[0]-b[0])
else:
  print(n-max(a[0]+b[1],a[1]+b[0]))
Problem p03474 (python)

Fixed submission:
A,B = map(int,input().split())
S = input()
L = list(map(str,list(range(10))))
flag = True
for i in range(A+B+1):
    if ( i == A ):
        if (S[i] != "-"):
            flag = False
    else:
        if (not (S[i] in L)):
            flag = False
if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
S = input()
L = list(range(10))
flag = True
for i in range(A+B+1):
    if ( i == A ):
        if (S[i] != "-"):
            flag = False
    else:
        if (not (int(S[i]) in L)):
            flag = False
if flag:
    print("Yes")
else:
    print("No")
Problem p03139 (python)

Fixed submission:
N,A,B=map(int,input().split())
#the max
print(min(A,B),max(0,A+B-N))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input.split())
#the max
print(min(A,B))
print(max(0,A+B-N))

Buggy submission (verdict: Runtime Error):
sumu,x,y=(map(int,input.split()))
minum=max(x+y-sumu,0)
maxim=min(x,y)
print(maxim,minum)
Problem p02817 (python)

Fixed submission:
a = input().split()
print(f"{a[1]}{a[0]}")

Buggy submission (verdict: Runtime Error):
print(f"{T}{S}")

Buggy submission (verdict: Runtime Error):
f"{T}{S}"
Problem p03145 (python)

Fixed submission:
def main():
    ab, bc, _ = get_params()
    print(area(ab, bc))


def get_params():
    return [int(s) for s in input().split()]


def area(ab, bc):
    return ab * bc // 2


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from typing import List


def main() -> None:
    ab, bc, _ = get_params()
    print(area(ab, bc))


def get_params() -> List[int]:
    return [int(s) for s in input().split()]


def area(ab: int, bc: int) -> int:
    return ab * bc // 2


if __name__ == "__main__":
    main()
Problem p03211 (python)

Fixed submission:
num=753; mindif=753
s=input()

for i in range(len(s)-2):
    dif=abs(int(s[i:i+3])-num)
    
    if (dif<mindif):
        mindif=dif

print(mindif)

Buggy submission (verdict: Runtime Error):
#include <iostream>
using namespace std;

int main() {
  int num=753, min=999;
  string s;
  cin >> s;

  for (int i=0; i<s.size()-2; i++) {
    int dif=abs(num-stoi(s.substr(i, 3)));

    if (dif<min) min=dif;
  }

  cout << min;
}
Problem p03992 (python)

Fixed submission:
s=input()

for i, j in enumerate(s):
    if i==4:
        print(" ", end="")
    print(j, end="")
print("")

Buggy submission (verdict: Runtime Error):
#include <iostream>
using namespace std;

int main() {
  string s;
  cin >> s;

  for (int i=0; i<s.size(); i++) {
    if (i==4) cout << ' ';
    else cout << s[i];
  }
}
Problem p02889 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
E - Travel by Car
https://atcoder.jp/contests/abc143/tasks/abc143_e

"""
import sys


from scipy.sparse.csgraph import floyd_warshall

def main(args):
    N, M, L = map(int, input().split())
    g1 = [[float('inf')] * (N+1) for _ in range(N+1)]
    for i in range(N+1):
        g1[i][i] = 0
    for _ in range(M):
        A, B, C = map(int, input().split())
        g1[A][B] = g1[B][A] = C
    d1 = floyd_warshall(g1)
    g2 = [[float('inf')] * (N+1) for _ in range(N+1)]
    for i in range(N+1):
        for j in range(N+1):
            if i == j:
                g2[i][j] = 0
            elif d1[i][j] <= L:
                g2[i][j] = g2[j][i] = 1
    d2 = floyd_warshall(g2)
    Q = int(input())
    for _ in range(Q):
        s, t = map(int, input().split())
        print(-1 if d2[s][t] == float('inf') else int(d2[s][t]) - 1)


if __name__ == '__main__':
    main(sys.argv[1:])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
E - Travel by Car
https://atcoder.jp/contests/abc143/tasks/abc143_e

"""
import sys


from scipy.sparse.csgraph import floyd_warshall

def main(args):
    N, M, L = map(int, input().split())
    g1 = [[float('inf')] * (N+1) for _ in range(N+1)]
    for i in range(N+1):
        g1[i][i] = 0
    for _ in range(M):
        A, B, C = map(int, input().split())
        g1[A][B] = g1[B][A] = C
    d1 = floyd_warshall(g1)
    g2 = [[float('inf')] * (N+1) for _ in range(N+1)]
    for i in range(N+1):
        for j in range(N+1):
            if i == j:
                g2[i][j] = 0
            elif d1[i][j] <= L:
                g2[i][j] = g2[j][i] = 1
    d2 = floyd_warshall(g2)
    Q = int(input())
    for _ in range(Q):
        s, t = map(int, input().split())
        print(-1 if d2[s][t] == float('inf') else int(d2[s][t]) - 1)


if __name__ == '__main__':
    main(sys.argv[1:])
Problem p03043 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
C - Dice and Coin
https://atcoder.jp/contests/abc126/tasks/abc126_c

"""
import sys


from decimal import *
from math import log2, ceil

#TLE
def __solve(N, K):
    getcontext().prec = 30
    ans = Decimal(0)
    for i in range(1, N+1):
        if i >= K:
            t = Decimal (1/N)
        else:
            t = Decimal(1/N/2**ceil(log2(K/i)))
        ans += t
    return ans


def solve(N, K):
    ans = 0
    for i in range(1, N+1):
        if i >= K:
            t = 1 / N
        else:
            t = 1/N/2**ceil(log2(K/i))
        ans += t
    return ans


def main(args):
    N, K = map(int, input().split())
    ans = solve(N, K)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
C - Dice and Coin
https://atcoder.jp/contests/abc126/tasks/abc126_c

"""
import sys


from decimal import *
from math import log2, ceil


def solve(N, K):
    getcontext().prec = 30
    ans = Decimal(0)
    for i in range(1, N+1):
        if i >= K:
            t = Decimal (1/N)
        else:
            t = Decimal(1/N/2**ceil(log2(K/i)))
        ans += t
    return ans


def main(args):
    N, K = map(int, input().split())
    ans = solve(N, K)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
Problem p03074 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
D - Handstand
https://atcoder.jp/contests/abc124/tasks/abc124_d
WA
"""
import sys


from itertools import groupby
from collections import deque

def solve(N, K, S):
    seq = [[k, len(list(g))]  for k, g in groupby(S)]
    if len(seq) <= 2*K:
        return len(S)
    if seq[0][0] == '0':
        seq = [['1', 0]] + seq
    if len(seq) % 2 == 0:
        seq.append(['1', 0])

    seq = deque(seq)
    rem = deque()
    ans = 0
    for i in range(2*K+1):
        _, v = seq.popleft()
        ans += v
        rem.append(v)

    max_ans = ans
    while seq:
        _, v = seq.popleft()
        ans += v
        rem.append(v)
        ans -= rem.popleft()
        _, v = seq.popleft()
        ans += v
        rem.append(v)
        ans -= rem.popleft()
        max_ans = max(max_ans, ans)
    return max_ans


def main(args):
    N, K = map(int, input().split())
    S = input()
    ans = solve(N, K, S)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
D - Handstand
https://atcoder.jp/contests/abc124/tasks/abc124_d

"""
import sys


from itertools import groupby
from collections import deque

def solve(N, K, S):
    seq = [[k, len(list(g))]  for k, g in groupby(S)]
    if len(seq) <= 2*K:
        return len(S)
    if seq[0][0] == '0':
        seq = [['1', 0]] + seq
    if len(seq) % 2 == 0:
        seq.append(['1', 0])

    seq = deque(seq)
    rem = deque()
    ans = 0
    for i in range(2*K+1):
        _, v = seq.popleft()
        ans += v
        rem.append(v)

    max_ans = ans
    while seq:
        ans -= rem.popleft()
        ans -= rem.popleft()
        _, v = seq.popleft()
        ans += v
        _, v = seq.popleft()
        ans += v
        max_ans = max(max_ans, ans)
    return max_ans


def main(args):
    N, K = map(int, input().split())
    S = input()
    ans = solve(N, K, S)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
Problem p03160 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
https://atcoder.jp/contests/dp/tasks/dp_a

"""
import sys
from sys import stdin
input = stdin.readline


def solve(N, ashiba):
    dp = [0] * N
    for i in range(1, N):
        dp[i] = min(dp[i-1] + abs(ashiba[i] - ashiba[i-1]), dp[i-2] + abs(ashiba[i] - ashiba[max(i-2, 0)]))
    return dp[-1]


def main(args):
    N = int(input())
    ashiba = [int(a) for a in input().split()]
    ans = solve(N, ashiba)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Buggy submission (verdict: Runtime Error):
def solve(ashiba, N, K):
    dp = [float('inf')] * N
    dp[0] = 0
    for i in range(1, len(ashiba)):
        paths = [dp[j]+abs(ashiba[j]-ashiba[i]) for j in range(max(0, i-K), i)]
        dp[i] = min(paths)
    return dp[-1]


N, K = map(int, input().split())
ashiba = [int(i) for i in input().split()]
ans = solve(ashiba, N, K)
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
B - Frog 2
https://atcoder.jp/contests/dp/tasks/dp_b
AC
"""
import sys
from sys import stdin


def solve(ashiba, N, K):
    dp = [float('inf')] * N
    dp[0] = 0
    for i in range(1, len(ashiba)):
        paths = [dp[j]+abs(ashiba[j]-ashiba[i]) for j in range(max(0, i-K), i)]
        dp[i] = min(paths)
    return dp[-1]


def main(args):
    N, K = map(int, input().split())
    ashiba = [int(i) for i in input().split()]
    ans = solve(ashiba, N, K)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
https://atcoder.jp/contests/dp/tasks/dp_a

"""
import sys
from sys import stdin
input = stdin.readline


def solve(N, ashiba):
    dp = [0] * N
    for i in range(1, N):
        dp[i] = min(dp[i-1] + abs(ashiba[i] - ashiba[i-1]), dp[i-2] + abs(ashiba[i] - ashiba[max(i-2, 0)]))
    return dp[-1]


import numpy as np

def main(args):
    N = int(input())
    ashiba = [int(a) for a in input().split()]
    if N <= 50000:
        ans = solve(N, ashiba)
    else:
        route_list=np.zeros((N, N))
        ans = 0
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
Problem p03401 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
C - Traveling Plan
https://beta.atcoder.jp/contests/abc092/tasks/arc093_a

"""
import sys
from sys import stdin

input = stdin.readline


def solve(spots, N):
    total_cost = 0
    cp = 0
    for s in spots:
        total_cost += abs(s - cp)
        cp = s
    total_cost += abs(spots[-1])

    ans = []
    spots.append(0)
    spots.insert(0, 0)
    for i in range(1, N):
        if spots[i-1] <= spots[i] <= spots[i+1] or spots[i-1] >= spots[i] >= spots[i+1]:
            ans.append(total_cost)
        else:
            if spots[i] <= spots[i-1] <= spots[i+1]:
                t = abs(spots[i] - spots[i-1]) * 2
            elif spots[i-1] <= spots[i+1] <= spots[i]:
                t = abs(spots[i] - spots[i+1]) * 2
            elif spots[i-1] >= spots[i+1] >= spots[i]:
                t = abs(spots[i] - spots[i+1]) * 2
            else:
                t = abs(spots[i] - spots[i-1]) * 2
            ans.append((total_cost - t))

    spots = spots[:-2]
    total_cost = 0
    cp = 0
    for s in spots:
        total_cost += abs(s - cp)
        cp = s
    total_cost += abs(spots[-1])
    ans.append(total_cost)

    return ans


def main(args):
    N = int(input())
    spots = [int(x) for x in input().split()]
    ans = solve(spots, N)
    print(*ans, sep='\n')


if __name__ == '__main__':
    main(sys.argv[1:])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
C - Traveling Plan
https://beta.atcoder.jp/contests/abc092/tasks/arc093_a

"""
import sys
from sys import stdin

input = stdin.readline


def solve(spots, N):
    spots.append(0)
    total_cost = 0
    cp = 0
    for s in spots:
        total_cost += abs(s - cp)
        cp = s
    # total_cost += abs(spots[-1])

    ans = []
    spots.insert(0, 0)
    for i in range(1, N):
        if spots[i-1] <= spots[i] <= spots[i+1] or spots[i-1] >= spots[i] >= spots[i+1]:
            ans.append(total_cost)
        else:
            t1 = abs(spots[i-1] - spots[i]) * 2
            ans.append((total_cost - t1))

    if spots[-3] >= spots[-2] >= spots[-1] or spots[-3] <= spots[-2] <= spots[-1]:
        ans.append(total_cost)
    else:
        if spots[-2] <= spots[-3] <= spots[-1]:
            t2 = abs(spots[-3] - spots[-2]) * 2
        elif spots[-2] <= spots[-1] <= spots[-3]:
            t2 = abs(spots[-1] - spots[-2]) * 2
        ans.append(total_cost - t2)


    return ans


def main(args):
    N = int(input())
    spots = [int(x) for x in input().split()]
    ans = solve(spots, N)
    print(*ans, sep='\n')


if __name__ == '__main__':
    main(sys.argv[1:])
Problem p03416 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
B - Palindromic Numbers
https://beta.atcoder.jp/contests/abc090/tasks/abc090_b

"""
import sys
from sys import stdin
input = stdin.readline


def solve(A, B):
    ans = 0
    for i in range(A, B+1):
        s1 = str(i)
        s2 = s1[::-1]
        if s1 == s2:
            ans += 1
    return ans


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)

if __name__ == '__main__':
    main(sys.argv[1:])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
B - Palindromic Numbers
https://beta.atcoder.jp/contests/abc090/tasks/abc090_b

"""
import sys
from sys import stdin
input = stdin.readline


def solve(A, B):
    ans = 0
for i in range(A, B+1):
        s1 = str(i)
        s2 = s1[::-1]
        if s1 == s2:
            ans += 1
    return ans


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)

if __name__ == '__main__':
    main(sys.argv[1:])
Problem p04013 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
https://beta.atcoder.jp/contests/abc044/tasks/arc060_a

"""
import sys
from sys import stdin
input = stdin.readline


def solve(N, A, cards):
    ans = 0
    cards.append(0)
    cards.sort()
    W = sum(cards)

    # dp[j][k][s]: j番目までのカードをk枚使って合計をsにする組み合わせ
    dp = [[[0] * (W+1) for _ in range(N+1)] for _ in range(N+1)]
    for j in range(N+1):
        dp[j][0][0] = 1

    for j in range(1, N+1):
        card = cards[j]
        for k in range(1, N+1):
            for s in range(1, W+1):
                if s < card:
                    dp[j][k][s] = dp[j-1][k][s]
                else:
                    dp[j][k][s] = dp[j-1][k][s] + dp[j-1][k-1][s-card]

    for k in range(1, N+1):
        if k*A <= W:
            ans += dp[N][k][k*A]
    return ans


def main(args):
    N, A = map(int, input().split())
    cards = [int(x) for x in input().split()]
    ans = solve(N, A, cards)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
https://beta.atcoder.jp/contests/abc044/tasks/arc060_a

"""
import sys
from sys import stdin
from copy import copy, deepcopy
input = stdin.readline


def solve(N, A, cards):
    ans = 0
    cards.append(0)
    cards.sort()
    W = max(cards) * N

    # dp[j][k][s]: j番目までのカードをk枚使って合計をsにする組み合わせ
    dp = [[[0] * (W+1) for _ in range(N+1)] for _ in range(N+1)]
    for j in range(N+1):
        dp[j][0][0] = 1

    for j in range(1, N+1):
        card = cards[j]
        for k in range(1, N+1):
            for s in range(1, W+1):
                if s < card:
                    dp[j][k][s] = dp[j-1][k][s]
                else:
                    dp[j][k][s] = dp[j-1][k][s] + dp[j-1][k-1][s-card]

    for k in range(1, N+1):
        ans += dp[N][k][k*A]
    return ans


def main(args):
    N, A = map(int, input().split())
    cards = [int(x) for x in input().split()]
    ans = solve(N, A, cards)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
Problem p02848 (python)

Fixed submission:
n=int(input())
s=input()
l=list(s)
newcome=[]
alp=[chr(ord('A') + i) for i in range(26)]
for i in l:
  a=alp.index(i)
  if (a+n)<26:
    t=alp[a+n]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
l=list(s)
newcome=[]
alp=[chr(ord('A') + i) for i in range(26)]
for i in l:
  a=alp.index(i)
  if (a+n)<=26:
    t=alp[a+n]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
l=list(s)
newcome=[]
alp=[chr(ord('A') + i) for i in range(26)]
for i in l:
  a=alp.index(i)
  if (a+n)<=26:
    t=alp[a+n]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))
Problem p02861 (python)

Fixed submission:
from math import sqrt
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
result=0
nums=[x for x in range(n)]
for i in nums:
  for j in nums:
    if(i!=j):
      result += sqrt((l[i][0] - l[j][0]) * (l[i][0] - l[j][0]) + (l[i][1] - l[j][1]) * (l[i][1] - l[j][1]))
print(result/n)

Buggy submission (verdict: Runtime Error):
from math import sqrt
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
result=0
nums=[x for x in range(n)]
for i in nums:
  for j in nums:
    if(i!=j):
      result += sqrt((xy[i][0] - xy[j][0]) * (xy[i][0] - xy[j][0]) + (xy[i][1] - xy[j][1]) * (xy[i][1] - xy[j][1]))
print(result/n)

Buggy submission (verdict: Runtime Error):
from math import sqrt
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
result=0
nums=[x for x in range(n)]
for i in nums:
  for j in nums:
    if(i!=j):
      result += sqrt((xy[i][0] - xy[j][0]) * (xy[i][0] - xy[j][0]) + (xy[i][1] - xy[j][1]) * (xy[i][1] - xy[j][1]))
print(result/n)
Problem p02899 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
d=[0]*n
for i,val in enumerate(l):
  d[val-1]=i+1
print(*d)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
d=[0]*n
for i,val in enumerate(l):
  d[v-1]=i+1
print(d)
Problem p02922 (python)

Fixed submission:
l=list(map(int,input().split()))
a=l[0]
b=l[1]
c=a-1
cnt=1
if(a>b and b==1):
  print(0)
else:
  while a<b:
    a=a+c
    cnt+=1
  print (cnt)

Buggy submission (verdict: Runtime Error):
l=list(map(int,input().split()))
a=l[0]
b=l[1]
nums=[i for i in range(20)]
for n in nums:
  if(b<=a*(i+1)-i):
    print(i+1)
    break
Problem p02923 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
cnt=0
t=0
for i in range(n-1):
  if(l[i]>=l[i+1]):
    cnt+=1
  else:
    t=max(cnt,t)
    cnt=0
t=max(cnt,t)
print(t)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
cnt=0
t=0
for i in range(n-1):
  if(l[i]>=l[i+1]):
    cnt+=1
  else:
    t=max(cnt,t)
    cnt=0
t=max(cnt,%tb)
print(t)
Problem p02971 (python)

Fixed submission:
n=int(input())
l=[int(input()) for i in range(n)]
s=sorted(l)
p=s[-1]
q=s[-2]
for i in range(n):
  if l[i]==p:
    print(q)
  else:
    print(p)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for i in range(n)]
s=sorted(l)
m=s[-1]
n=s[-2]
nums=[i for i in range(n)]
for num in nums:
  if(l[num]!=m):
    print(m)
  else:
    print(n)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for i in range(n)]
s=sorted(l)
m=s[-1]
n=s[-2]
nums=[i for i in range(n)]
for num in nums:
  if(l[num]!=m:
    print(m)
  else:
    print(n)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for i in range(n)]
m=max(l)
nums=[i for i in range(n)]
for num in nums:
  if(l[num]!=m):
    print(m)
  else:
    s=[x for x in l if x!=m]
    print(max(s))
Problem p03029 (python)

Fixed submission:
l=list(map(int,input().split()))
a=l[0]
p=l[1]
print((3*a+p)//2)

Buggy submission (verdict: Runtime Error):
l=list(map(int,input().split()))
a=l[0]
p=l[1]
print((3a+p)//2)
Problem p03997 (python)

Fixed submission:
l=[int(input()) for i in range(3)]
a=l[0]
b=l[1]
h=l[2]
print((a+b)*h//2)

Buggy submission (verdict: Runtime Error):
l=[int(input()) for in in range(3)]
a=l[0]
b=l[1]
h=l[2]
print((a+b)*h//2)

Buggy submission (verdict: Runtime Error):
l=list(map(int,input().split()))
a=l[0]
b=l[1]
h=l[2]
print((a+b)*h//2)