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

Fixed submission:
import math
import itertools

N = int(input())
P = tuple(map(int,input().split()))
Q = tuple(map(int,input().split()))

li = list(itertools.permutations(P,N))
li.sort()

a = 0
b = 0

for i in range(math.factorial(N)):
    if li[i] == P:
        a = i
    else:
        a = a

for i in range(math.factorial(N)):
    if li[i] == Q:
        b = i
    else:
        b = b
        
print(abs(a-b))

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

li = list(itertools.permutations(P,N))
li.sort()

a = 0
b = 0

for i in range(math.factorial(N)):
    if li[i] == P:
        a = i
    elif li[i] == Q:
        b = i
    else:
        a = a
        b = b
        
print(abs(a-b))

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

li = list(itertools.permutations(P ,N))

a = 0
b = 0

for i in range(math.factorial(N)):
    if li[i] == P:
        a = i
    elif li[i] == Q:
        b = i
    else:
        a = a
        b = b
        
print(abs(a-b))

Buggy submission (verdict: Runtime Error):
#C - Count Order
N = int(input())
P = tuple(map(int,input().split()))
Q = tuple(map(int,input().split()))

li = list(itertools.permutations(P ,N))

a = 0
b = 0

for i in range(math.factorial(3)):
    if li[i] == P:
        a = i
    elif li[i] == Q:
        b = i
    else:
        a = a
        b = b
        
print(abs(a-b))
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())

if L == 0:
    print(0)
elif not L // 2019 == R // 2019:
    print(0)
else:
    L %= 2019
    R %= 2019
    ans = 2020
    for i in range(L, R):
        for j in range(i+1, R+1):
            tmp = (i * j) % 2019
            if tmp < ans:
                ans = tmp
    print(ans)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())

print(min([i * j % 2019 for i in range(L, R) for j in range(i+1, R)]))
Problem p03085 (python)

Fixed submission:
base = {'A':'T', 'C':'G', 'G':'C', 'T':'A'}
 
b = input()
print(base[b])

Buggy submission (verdict: Runtime Error):
base = {'A':'A', 'C':'T', 'G':'C', 'T':'G'}

b = int(input())
print(base[b])
Problem p03146 (python)

Fixed submission:
def f(n):
  if n % 2 == 0:
    return n//2
  else:
    return 3*n + 1


s = int(input())
a = [s]
i = 0
while True:
  s = f(a[i])
  if s in a:
    print(i+2)
    break
  else:
    a.append(s)
    i += 1

Buggy submission (verdict: Runtime Error):
def f(n):
  if n % 2 == 0:
    return n//2
  else:
    return 3*n + 1


s = int(input())
a = [s]
i = 0
while True:
  s = f(a[i])
  if a in s:
    print(i)
    break
  else:
    a.append(s)
    i += 1

Buggy submission (verdict: Runtime Error):
def f(n):
  if n % 2 == 0:
    return n//2
  else:
    return 3*n + 1


s = int(input())
a = [s]
i = 0
while True:
  s = f(a[i])
  if a in s:
    print(i)
    break
  else:
    a.ppend(s)
    i += 1
Problem p04043 (python)

Fixed submission:
x = list(map(int,input().split()))
n5=0
n7=0
for i in range(len(x)):
    if(x[i]==5):n5=n5+1
    if(x[i]==7):n7=n7+1
if(n5==2 and n7==1):print("YES")
else:print("NO")

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
d = list(map(str, input().split()))
while(n>0):
    S = str(n)
    t = 0
    for i in S:
        if i not in d:
            t += 1
    if t == len(S):
        print(int(S))
        break
    else:
        n += 1
Problem p02911 (python)

Fixed submission:
n, k, q= map(int, input().split())
a = [int(input()) for i in range(q)]

b = [k - q] * n

for i in range(q):
    b[a[i] - 1] += 1

for j in range(n):
    if b[j] > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
n, k, q= map(int, input().split())
a = [int(input()) for i in range(q)]

b = [k - q] * n

for i in range(q):
    b[a[i - 1]] += 1

for i in range(n):
    if b[i] > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
n, k, q= map(int, input().split())
a = [int(input()) for i in range(q)]

b = [k - q] * n

for i in range(q):
    b[a[i - 1]] += 1

for i in range(n):
    if b[i] > 0:
        print('Yes')
    else:
        print('No')
Problem p02971 (python)

Fixed submission:
N = int(input())
A = list(int(input()) for i in range(N))

max_value = max(A)
number = A.count(max_value)

if number > 1:
    for j in range(N):
        print(max_value)
else:
    position = A.index(max_value)
    A.remove(max_value)
    for j in range(N):
        if j == position:
            print(max(A))
        else:
            print(max_value)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = tuple(int(input()) for i in range(N)

B = list(A)

for j in range(N):
    B.pop(j)
    print(max(B))
    B = list(A)
Problem p02780 (python)

Fixed submission:
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

import itertools

# import math
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, K, *P = map(int, read().split())
R = list(itertools.accumulate(P))
ans = 0
for i in range(K - 1, N):
    if i - K >= 0:
        s = ((R[i] - R[i - K]) + K) / 2
    else:
        s = (R[i] + K) / 2
    ans = max(s, ans)
print('{:.6f}'.format(ans))

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, K, *P = map(int, read().split())

ans = 0
for i in range(N - K + 1):
    L = P[i:i + K]
    s = (sum(L) + K) / 2
    ans = max(s, ans)
print(f'{ans:.10f}')
Problem p02801 (python)

Fixed submission:
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

H = readline().decode('utf8').strip()
print(chr(ord(H) + 1))

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

H = readline().decode('utf8')
print(chr(ord(H) + 1))
Problem p02887 (python)

Fixed submission:
"""
author : halo2halo
date : 19,Oct,2019
"""

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
words = readline().rstrip()
preword = '1'
ans = 0
for word in words:
    if preword != word:
        ans += 1
        preword = word

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input().split()
print(len(set(S))
Problem p02945 (python)

Fixed submission:
"""
author : halo2halo
date : 19,Oct,2019
"""

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

A,B=map(int,readline().split())

print(max({A * B, A + B, A - B}))

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 19,Oct,2019
"""

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

A,B=map(int,readline())

print(max({A * B, A + B, A - B}))
Problem p02957 (python)

Fixed submission:
"""
author : halo2halo
date : 10, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, read().split())
S = N + M

print(S // 2 if S % 2 == 0 else 'IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 10, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buf"""
author : halo2halo
date : 11, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, read().split())
S = N + M

print(S // 2 if S % 2 == 0 else 'IMPOSSIBLE')
fer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, read().split())
S = N + M

print(S // 2 if S % 2 == 0 else 'IMPOSSIBLE')
Problem p02969 (python)

Fixed submission:
"""
author : halo2halo
date : 13,Nov,2019
"""

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

print(3*int(read())**2)

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 13,Nov,2019
"""

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

print(3*int(read()**2))
Problem p03060 (python)

Fixed submission:
"""
author : halo2halo
date : 12, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
V = map(int, readline().split())
C = map(int, readline().split())
ans = 0
for v, c in zip(V, C):
    if v - c > 0:
        ans += v - c

print(ans)

Buggy submission (verdict: Runtime Error):
#include <stdio.h>
#include <vector>

using namespace std;
typedef long long ll;

int main()
{
    int N, ans = 0;
    vector<int> V(N), C(N);
    scanf("%d", &N);
    for (int i = 0; i < N; i++)
    {
        scanf("%d", V.at(i));
    }
    for (int i = 0; i < N; i++)
    {
        scanf("%d", C.at(i));
    }

    for (int i = 0; i < N; i++)
    {
        if (V.at(i) - C.at(i) >= 0)
        {
            ans += V.at(i) - C.at(i);
        }
    }

    printf("%d", ans);

    return 0;
}
Problem p03160 (python)

Fixed submission:
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *H = map(int, read().split())
dp = [0] * N
dp[1] = abs(H[1] - H[0])

for i in range(2, N):
    dp[i] = min(dp[i - k] + abs(H[i] - H[i - k]) for k in [1, 2])

ans = dp[-1]
print(ans)

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *H = map(int, readline().split())
dp = [0] * N
dp[1] = abs(H[1] - H[0])

for i in range(2, N):
    dp[i] = min(dp[i - k] + abs(H[i] - H[i - k]) for k in [1, 2])

ans = dp[-1]
print(ans)
Problem p03220 (python)

Fixed submission:
"""
author : halo2halo
date : 16, Jan, 2020
"""

import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
T, A = map(int, readline().split())
H = np.array([int(x) for x in readline().split()])
# print(H)
H = 1000 * T - H * 6
# print(H)
H = abs(H - A*1000)
# print(H)

ans = 0
tmp = 10000000
for num, i in enumerate(H):
    if tmp >= i:
        ans = num
        tmp = i
print(ans + 1)

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 25,Oct,2019
"""

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline().rstrip())
T, a = map(int, readline().rstrip().split())
lis = list(map(int, readline().rstrip().split()))
cnt = 100000
for num, area in enumerate(lis):
    res = abs(T * 1000 - area * 6 - a * 1000)
    if res <= cnt:
        cnt = res
        ans = num


print(ans+1)
Problem p03282 (python)

Fixed submission:
import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = readline().decode().strip()
K = int(readline())
cnt = 0
tmp = 0

for i in N:
    if i == '1':
        cnt += 1
        continue
    else:
        tmp = int(i)
        break
ans = N[tmp-1] if K <= cnt else tmp

print(ans)

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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = readline().decode().strip()
K = int(readline())
cnt = 0
tmp = 0

for i in N:
    if i == '1':
        cnt += 1
        continue
    else:
        tmp = i
        break
ans = N[tmp-1] if K <= cnt else tmp

print(ans)
Problem p03289 (python)

Fixed submission:
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = list(readline().decode('utf8').rstrip())
bl = S[0] == 'A'
bl &= ('C' in S[2:-1])

if bl:
    S.remove('A')
    S.remove('C')

bl &= all('a' <= x <= 'z' for x in S)

print('AC' if bl else 'WA')

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = readline().decode('utf8').rstrip()
lis = list(S)
# print(lis)
print(lis.index('C'))
print(len(lis))
if lis[0] == 'A' and 2 <= lis.index('C') <= len(lis) - 2:
    st = ''.join(lis[1:lis.index('C')] + lis[lis.index('C') + 1:])
    # print(st)
    if st.lower():
        print('AC')
    else:
        print('WA')

else:
    print('WA')

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = readline().decode('utf8').rstrip()
lis = list(S)
# print(lis)
if lis[0] == 'A' and 2 <= lis.index('C') <= len(lis) - 1:
    st = ''.join(lis[1:lis.index('C')] + lis[lis.index('C') + 1:])
    # print(st)
    if st.lower():
        print('AC')
    else:
        print('WA')

else:
    print('WA')

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = readline().decode('utf8').rstrip()
lis = list(S)
print(lis)
if lis[0] == 'A' and 2 <= lis.index('C') <= len(lis) - 1:
    st = ''.join(lis[1:lis.index('C')] + lis[lis.index('C') + 1:])
    print(st)
    if st.lower():
        print('AC')
    else:
        print('WA')

else:
    print('WA')
Problem p03386 (python)

Fixed submission:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A, B, K = map(int, readline().split())
ans=''
if B-A+1 <= 2 * K:
    ans += '\n'.join(str(x) for x in range(A, B + 1))
else:
    ans += '\n'.join(str(x) for x in range(A, A + K))
    ans+='\n'
    ans += '\n'.join(str(x) for x in range(B + 1 - K, B + 1))
print(ans)

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A, B, K = map(int, readline().split())
se = set(range(A, A + K) | range(B - K + 1, B + 1))
li = list(se)
li = [x for x in li if A << x << B]

li.sort()
print(*li, sep='\n')
Problem p03399 (python)

Fixed submission:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b, c, d = map(int, read().split())
print(min(a, b) + min(c,d))

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b, c, d = map(int, readline().split())
print(min(a, b) + min(c,d))

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b, c, d = map(int, readline().split())
print(min(a, b) + min(c + d))
Problem p03478 (python)

Fixed submission:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, A, B = map(int, readline().split())
ans = 0
for i in range(N + 1):
    s = 0
    t = i
    while t:
        s += t % 10
        t = t // 10

    if A <= s <= B:
        ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <cmath>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

int main()
{
        int N, A, B, ans = 0;
        cin >> N >> A >> B;
        rep(i, N + 1)
        {
                int t = i, cnt = 0;
                while (t > 0)
                {
                        cnt += t % 10;
                        t /= 10;
                }
                if (A <= cnt && cnt <= B)
                        ans += i;
        }
        cout << ans << endl;

        return 0;
}
Problem p03486 (python)

Fixed submission:
"""
author : halo2halo
date : 25,Oct,2019
"""

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

a = readline().rstrip()
b = readline().rstrip()

print("Yes" if ''.join(sorted(a)) < ''.join(sorted(b)[::-1]) else "No")

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s, t = readline().decode('utf8').split()
s.sort()
t.sort()
print('Yes' if s < t[::-1] else 'No')
Problem p03563 (python)

Fixed submission:
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A, B = map(int,read().decode('utf8').split())
print(2*B-A)

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A, B = read().decode('utf8').split()
print(2*B-A)
Problem p03632 (python)

Fixed submission:
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A, B, C, D = map(int, readline().split())

start = max(A, C)
end = min(B, D)
ans = max(0, end - start)
print(ans)

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A,B,C,D = map(int,readline().decode('utf8').rstrip())

print(B-C if B>C else 0)
Problem p03636 (python)

Fixed submission:
"""
author : halo2halo
date : 25,Oct,2019
"""

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N = readline().rstrip()

print(N[0]+str(len(N)-2)+N[-1])

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode('utf8')


print(S[0]+len(S[1:-1])+S[-1])
Problem p03694 (python)

Fixed submission:
"""
author : halo2halo
date : 30, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,*A = map(int, read().split())
A.sort()
print(A[-1]-A[0])

Buggy submission (verdict: Runtime Error):
"""
author : halo2halo
date : 30, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,*A = map(int, readline().split())
A.sort()
print(A[-1]-A[0])
Problem p03361 (python)

Fixed submission:
H, W = map(int, input().split())
s = [input() for _ in range(H)]
#print(s)

f1 = True
for i in range(H):
  if not f1:
    break
  for j in range(W):
    if not f1:
      break
    if s[i][j] == '.':
      continue
    f = False
    if i >= 1 and s[i-1][j] == '#':
      f = True
    if j <= W-2 and s[i][j+1] == '#':
      f = True
    if i <= H-2 and s[i+1][j] == '#':
      f = True
    if j >= 1 and s[i][j-1] == '#':
      f = True
    if not f:
      f1 = False

#print(s)
if f1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
s = [input() for _ in range(H)]
#print(s)

f1 = True
for i in range(H):
  if not f1:
    break
  for j in range(W):
    if not f1:
      break
    if s[i][j] == '.':
      continue
    f = False
    if i >= 1 and s[i-1][j] == '#':
      f = True
    if j <= W-2 and s[i][j+1] == '#':
      f = True
    if i <= H-2 and s[i+1][j] == '#':
      f = True
    if j >= 1 and s[i][j-1] == '#':
      f = True
    if not f:
      f1 = False

#print(s)
if f:
  print('Yes')
else:
  print('No')
Problem p04044 (python)

Fixed submission:
N, L = map(int, input().split())
S = [input() for _ in range(N)]
S.sort()
print("".join(S))

Buggy submission (verdict: Runtime Error):
L, N = map(int, input().split())
S = [input() for _ in range(N)]
S.sort()
print("".join(S))
Problem p02885 (python)

Fixed submission:
num1,num2 = map(int,input().split())
if num1 >= 2*num2:
    print(num1 - 2*num2)
else:
    print('0')

Buggy submission (verdict: Runtime Error):

num1 = int(input())
num2 = int(input())

if num1 >= 2*num2:
    print(num1 - 2*num2)
else:
    print(0)

Buggy submission (verdict: Runtime Error):

num1 = int(input())
num2 = int(input())

if num1 >= 2*num2:
    print(num1 - 2*num2)
else:
    print('0')
Problem p02778 (python)

Fixed submission:
a=input()
A=len(a)
b="x"
for i in range(A-1):
  b=b+"x"
print(b)

Buggy submission (verdict: Runtime Error):
a=input()
A=len(a)
b=x
for i in A-1:
  b=b+'x'
print(b)