Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N, M = map(int, raw_input().split())
start, finish = [], []
for i in range(M):
    a, b = map(int, raw_input().split())
    if a == 1:
        start.append(b)
    elif b == N:
        finish.append(a)

for s in start:
    for f in finish:
        if s == f:
            print 'POSSIBLE'
            exit()

print 'IMPOSSIBLE'


Fixed submission:
# -*- coding: utf-8 -*-

N, M = map(int, raw_input().split())
start, finish = [], []
for i in range(M):
    a, b = map(int, raw_input().split())
    if a == 1:
        start.append(b)
    elif b == N:
        finish.append(a)

if set(start) & set(finish):
    print 'POSSIBLE'
else:
    print 'IMPOSSIBLE'

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N, M = map(int, raw_input().split())
start, finish = [], []
for i in range(M):
    a, b = map(int, raw_input().split())
    if a == 1:
        start.append([a, b])
    elif b == N:
        finish.append([a, b])

for s in start:
    for f in finish:
        if s[1] == f[0]:
            print 'POSSIBLE'
            exit()

print 'IMPOSSIBLE'


Fixed submission:
# -*- coding: utf-8 -*-

N, M = map(int, raw_input().split())
start, finish = [], []
for i in range(M):
    a, b = map(int, raw_input().split())
    if a == 1:
        start.append(b)
    elif b == N:
        finish.append(a)

if set(start) & set(finish):
    print 'POSSIBLE'
else:
    print 'IMPOSSIBLE'

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N, M = map(int, raw_input().split())
line = []   # 定期便
for i in range(M):
    a, b = map(int, raw_input().split())
    line.append([a, b])
line.sort()

for l in line:
    if l[0] > 1:
        break
    else:
        for k in line:
            if k[0] == l[1] and k[1] == N:
                print 'POSSIBLE'
                exit()

print 'IMPOSSIBLE'


Fixed submission:
# -*- coding: utf-8 -*-

N, M = map(int, raw_input().split())
start, finish = [], []
for i in range(M):
    a, b = map(int, raw_input().split())
    if a == 1:
        start.append(b)
    elif b == N:
        finish.append(a)

if set(start) & set(finish):
    print 'POSSIBLE'
else:
    print 'IMPOSSIBLE'

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N, M = map(int, raw_input().split())
line = []   # 定期便
for i in range(M):
    a, b = map(int, raw_input().split())
    line.append([a, b])

for l in line:
    if l[0] == 1:
        for k in line:
            if k[0] == l[1] and k[1] == N:
                print 'POSSIBLE'
                exit()

print 'IMPOSSIBLE'


Fixed submission:
# -*- coding: utf-8 -*-

N, M = map(int, raw_input().split())
start, finish = [], []
for i in range(M):
    a, b = map(int, raw_input().split())
    if a == 1:
        start.append(b)
    elif b == N:
        finish.append(a)

if set(start) & set(finish):
    print 'POSSIBLE'
else:
    print 'IMPOSSIBLE'
Buggy python submission (verdict: Runtime Error):
# -*- conding: utf-8 -*-

a = int(raw_input())
b = int(raw_input())
c = int(raw_input())

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'


Fixed submission:
#!/usr/bin/env python
# -*- conding: utf-8 -*-

raw = raw_input()
a = int(raw.split()[0])
b = int(raw.split()[1])
c = int(raw.split()[2])

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- conding: utf-8 -*-

a = int(raw_input())
b = int(raw_input())
c = int(raw_input())

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'


Fixed submission:
#!/usr/bin/env python
# -*- conding: utf-8 -*-

raw = raw_input()
a = int(raw.split()[0])
b = int(raw.split()[1])
c = int(raw.split()[2])

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'

Buggy python submission (verdict: Runtime Error):
#!/usr/local/env python
# -*- conding:utf-8 -*-

import sys

a = int(sys.argv[1])
b = int(sys.argv[2])
c = int(sys.argv[3])

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'

Fixed submission:
#!/usr/bin/env python
# -*- conding: utf-8 -*-

raw = raw_input()
a = int(raw.split()[0])
b = int(raw.split()[1])
c = int(raw.split()[2])

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'
Buggy python submission (verdict: Runtime Error):
N = int(input())
list = []
for i in range(N):
    number = int(input())
    if number in list:
        list.remove(number)
        #print(list)
    else:
        list.append(number)
        #print(list)
print(len(list))


Fixed submission:
N = input()
result = "No"
if N[0] == "9":
    result ="Yes"
if N[1] == "9":
    result = "Yes"
print (result)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
#Nをセットする
N = int(input())
#aiをセットする
a = list(map(int,input().split()))
a_mai = []
a_pura = []
#ai +- 1したものを作る
for i in range(len(a)):
    #+1したもの
    a_pura.append(a[i] + 1)
    #-1したもの
    a_mai.append(a[i] - 1)
#aiそのままの重複の数
count_a = Counter(a)
#ai + 1重複の数
count_a_pura = Counter(a_pura)
#ai - 1の中腹の数
counter_a_mai = Counter(a_mai)
#一番大きい要素を取得
max_a = count_a.most_common()[0][1]
max_a_pura = count_a_pura.most_common()[0][1]
max_a_mai = counter_a_mai.most_common()[0][1]

#3つの最大値を求める
max = max_a
if max_a_pura >= max:
    max = max_a_pura
if max_a_mai >= max:
    max = max_a_mai
print(max)

Fixed submission:
#砂時計の砂X(秒)をセット #測った時間tをセット
X , t = map(int,input().split())
#残り時間を表示 (X - t)
#X > tのとき
if X > t:
    time = X - t
#X <= tのとき
else:
    time = 0
print(time)
Buggy python submission (verdict: Runtime Error):
import math
#x a bを設定する
x,a,b = map(int,input().split())
#x からaまでの距離とxからbまでの距離を計算する
a_distant = math.sqrt((a - x)^2)
b_distant = math.sqrt((b - x)^2)
#aまでとbまでを比較して短い方を出力する
if a_distant > b_distant:
    print("B")
else:
    print("A")

Fixed submission:
import math
#x a bを設定する
x,a,b = map(int,input().split())
#x からaまでの距離とxからbまでの距離を計算する

a_distant = a - x
b_distant = b - x
if a_distant < 0:
    a_distant = a_distant*(-1)
if b_distant < 0:
    b_distant = b_distant*(-1)
#aまでとbまでを比較して短い方を出力する
if a_distant > b_distant:
    print("B")
else:
    print("A")

Buggy python submission (verdict: Runtime Error):
#x a bを設定する
x,a,b = map(int,input().split())
#x からaまでの距離とxからbまでの距離を計算する
a_distant = (a - x)^2
b_distant = (b - x)^2
#aまでとbまでを比較して短い方を出力する
if a_distant > b_distant:
    print("B")
if b_distant > a_distant
    print("A")


Fixed submission:
import math
#x a bを設定する
x,a,b = map(int,input().split())
#x からaまでの距離とxからbまでの距離を計算する

a_distant = a - x
b_distant = b - x
if a_distant < 0:
    a_distant = a_distant*(-1)
if b_distant < 0:
    b_distant = b_distant*(-1)
#aまでとbまでを比較して短い方を出力する
if a_distant > b_distant:
    print("B")
else:
    print("A")
Buggy python submission (verdict: Runtime Error):
m, n = map(int, input().split())
M = list(map(int, input().split()))
M.sort()
M.reverse()
A = []
for i in range(n):
    A.append(M[i])
print(sum(A))


Fixed submission:
a, b = map(int,input().split())
print("Possible" if(a+b)%3==0 or a%3==0 or b%3==0 else "Impossible")
Buggy python submission (verdict: Runtime Error):
 a,b,c = map(int,raw_input().split())
 print(a+b+c-max(a,b,c))


Fixed submission:
# -*- coding: utf-8 -*-

#お店にあるベルは 3 種類で、それぞれ a円、 b円、 c円です。
#この 3 つのうち、異なる 2 つのベルを選んで買うときの、値段の合計の最小値を求めて下さい。

x = input().split()
#x = [700, 600, 780]

y =[int(x[0]), int(x[1]), int(x[2])]

z = sorted(y)

ans = z[0] + z[1]

print(ans)

Buggy python submission (verdict: Runtime Error):
 a,b,c = map(int,raw_input().split())

Fixed submission:
# -*- coding: utf-8 -*-

#お店にあるベルは 3 種類で、それぞれ a円、 b円、 c円です。
#この 3 つのうち、異なる 2 つのベルを選んで買うときの、値段の合計の最小値を求めて下さい。

x = input().split()
#x = [700, 600, 780]

y =[int(x[0]), int(x[1]), int(x[2])]

z = sorted(y)

ans = z[0] + z[1]

print(ans)

Buggy python submission (verdict: Runtime Error):
 a,b,c = map(int,raw_input().split())
print(min(a+b,b+c,a+c))

Fixed submission:
# -*- coding: utf-8 -*-

#お店にあるベルは 3 種類で、それぞれ a円、 b円、 c円です。
#この 3 つのうち、異なる 2 つのベルを選んで買うときの、値段の合計の最小値を求めて下さい。

x = input().split()
#x = [700, 600, 780]

y =[int(x[0]), int(x[1]), int(x[2])]

z = sorted(y)

ans = z[0] + z[1]

print(ans)

Buggy python submission (verdict: Runtime Error):
 a,b,c = map(int,raw_input().split())

d = a + b
e = b  + c
f = a + c
print(min(d,e,f))


Fixed submission:
# -*- coding: utf-8 -*-

#お店にあるベルは 3 種類で、それぞれ a円、 b円、 c円です。
#この 3 つのうち、異なる 2 つのベルを選んで買うときの、値段の合計の最小値を求めて下さい。

x = input().split()
#x = [700, 600, 780]

y =[int(x[0]), int(x[1]), int(x[2])]

z = sorted(y)

ans = z[0] + z[1]

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
from itertools import permutations
 
def read_int_list():
    return list(map(int, input().split()))
 
 
def main():
    def floyd_warshall():
        for k in range(n):
            for i in range(n):
                for j in range(n):
                    dd = d[i][k] + d[k][j]
                    if dd < d[i][j]:
                        d[i][j] = dd
 
    n, m, r = read_int_list()
    v = read_int_list()
    v = [x - 1 for x in v]
    d = [[float('inf')] * n for i in range(n)]
    for i in range(n):
        d[i][i] = 0
    for i in range(m):
        a, b, c = read_int_list()
        a -= 1
        b -= 1
        d[a][b] = c
        d[b][a] = c
    floyd_warshall()
    res = float('inf')
    for p in permutations(v):
        s = 0
        for i in range(r - 1):
            s += d[p[i]][p[i + 1]]
        if s < res:
            res = s
    print(res)
 
 
main()

Fixed submission:
N = str(input())

if '9' in N:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
N = input()
ans = 0
for i in range(N):
	j,k = map(int,input().split())
	ans += r - l + 1
print(ans)

Fixed submission:
N = int(input())
ans = 0
for i in range(N):
	j,k = map(int,input().split())
	ans += k - j + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
def oddOut():

s = str(input())
print(s[::2])
        
 
pddOut()

Fixed submission:
def hourglass():
    X, t = list(map(int, input().split(" ")))
    if X - t <= 0:
        print(0)
    else:
        print(X - t)
        
 
hourglass()
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))

res = [0] * 100000

for i in a:
	list[i] += 1
	
print(max(map(sum,zip(list, list[1:], list[2:]))))

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
 
res = [0] * 100000
 
for i in a:
	res [i] += 1
	
print(max(map(sum,zip(res , res [1:], res [2:]))))
Buggy python submission (verdict: Runtime Error):
import numpy as np

def read_data():
    try:
        LOCAL_FLAG
        import codecs
        import os

        lines = []
        file_path = os.path.join(os.path.dirname(__file__), 'data.dat')
        with codecs.open(file_path, 'r', 'utf-8') as f:
            n_lines = int(f.readline())
            for i in range(n_lines):
                lines.append(f.readline().rstrip("\r\n"))

    except NameError:
        lines = []
        n_lines = int(input())
        for i in range(n_lines):
            lines.append(input())
    return lines



MAX = 10000000000

raw_data = read_data()
tarray = []
for each in raw_data:
    tarray.append(each.split())
A = np.array(tarray, dtype='int32')
B = np.zeros(A.shape, dtype='int32')

N = A.shape[0]

def distance2(i, j, done=[]):
    if(i == j):
        return 0

    min_dis = MAX
    min_index = -1
    for n in range(N):
        if((B[i][n] == 1)and(n not in done)and(n != j)):
            temp_dis = distance2(i, n, [i, j]) + distance2(n, j, [i, j])

            if(temp_dis < min_dis):
                min_index = n
                min_dis = temp_dis

    if(B[i][j] == 1)and(A[i][j] < min_dis):
        return A[i][j]
    else:
        return min_dis


def Restoring_Road_Network():

        # todo = list(range(N))
    min_dis_all = A[A.nonzero()].min()
    try:
        LOCAL_FLAG
        print("min value is", min_dis_all)
    except:
        pass

    for i in range(0, N):
        row = A[i]
        np.argmin(A[i])
        # print(row)
        min = MAX
        min_index = -1

        for j in range(0, N):
            if(row[j] == 0):
                continue
            elif(row[j] < min_dis_all*2):
                B[i][j] = 1
                B[j][i] = 1

            if(row[j] < min):
                min = row[j]
                min_index = j
        #
        # print(min)
        # print(min_index)
        B[i][min_index] = 1
        B[min_index][i] = 1


    distance_array = A*B
    not_available = False
    for i in range(N):
        for j in range(N):
            temp = distance2(i,j)
            # print(temp, " ", end='')
            if(temp != A[i][j]):
                not_available = True
        # print()

    try:
        LOCAL_FLAG
        print(B)
    except:
        pass

    if(not_available):
        print(-1)
    else:
        print(int(distance_array.sum(dtype=np.int64)/2))



# Sugar_water()
Restoring_Road_Network()

Fixed submission:
import numpy as np
N = int(input())
A = [np.array(input().split(), dtype=np.int64) for _ in [0]*N]
inf = 10**10
for i in range(N):
    A[i][i] = inf
 
result = 0
for i in range(N-1):
    for j, d1 in enumerate(A[i][i+1:], start=i+1):
        d2 = np.min(A[i]+A[j])
        if d1 >= d2:
            if d1 > d2:
                print(-1)
                exit()
        else:
            result += d1
print(result)
Buggy python submission (verdict: Runtime Error):
def A_Sandglass2():
    try:
        LOCAL_FLAG
        X = 100
        t = 170
    except NameError:
        X, t = list(map(int, input().split()))

    R = X - t
    if R > 0:
        print(R)
    else:
        print("0")

start = time.time()
A_Sandglass2()
elapsed_time = time.time() - start
try:
    LOCAL_FLAG
    print ("elapsed_time: {0}".format(elapsed_time) + "[sec]")
except NameError:
    pass

Fixed submission:
import numpy as np
import sys
import itertools
import time

# # A - Sandglass2
# #
# #
def A_Sandglass2():
    try:
        LOCAL_FLAG
        X = 100
        t = 170
    except NameError:
        X, t = list(map(int, input().split()))

    R = X - t
    if R > 0:
        print(R)
    else:
        print("0")

start = time.time()
A_Sandglass2()
elapsed_time = time.time() - start
try:
    LOCAL_FLAG
    print ("elapsed_time: {0}".format(elapsed_time) + "[sec]")
except NameError:
    pass
Buggy python submission (verdict: Runtime Error):
N = input()
A = input()

print(N*N-A)

Fixed submission:
N = int(input())
A = int(input())

print(N*N-A)

Buggy python submission (verdict: Runtime Error):
n = input()
a = input()

print ((n * n) - a)

Fixed submission:
N = int(input())
A = int(input())

print(N*N-A)

Buggy python submission (verdict: Runtime Error):
a = input()
n = input()

print ((n * n) - a)

Fixed submission:
N = int(input())
A = int(input())

print(N*N-A)

Buggy python submission (verdict: Runtime Error):
N = input()
A = input()

print (str(N * N - A))

Fixed submission:
N = int(input())
A = int(input())

print(N*N-A)

Buggy python submission (verdict: Runtime Error):
N = input()
A = input()

print str(N * N - A)

Fixed submission:
N = int(input())
A = int(input())

print(N*N-A)

Buggy python submission (verdict: Runtime Error):
N = input()
A = input()

print (N * N - A)

Fixed submission:
N = int(input())
A = int(input())

print(N*N-A)

Buggy python submission (verdict: Runtime Error):
N = imput()
A = imput()

print (N * N - A)

Fixed submission:
N = int(input())
A = int(input())

print(N*N-A)

Buggy python submission (verdict: Runtime Error):
N = imput()
A = imput()

print (N * N - A)

Fixed submission:
N = int(input())
A = int(input())

print(N*N-A)
Buggy python submission (verdict: Runtime Error):
input_line1 = raw_input()
c = 1
p = ""
for v in input_line1:
    if c == 1:
        p += v
        c = 0
    else:
        c += 1
print(p)

Fixed submission:
input_line1 = str(input())
c = 1
p = ""
for v in input_line1:
    if c == 1:
        p += v
        c = 0
    else:
        c += 1
print(p)

Buggy python submission (verdict: Runtime Error):
input_line1 = raw_input()
c = 1
p = ""
for v in input_line1:
    if c == 1:
        p += v
        c = 0
    else:
        c += 1

Fixed submission:
input_line1 = str(input())
c = 1
p = ""
for v in input_line1:
    if c == 1:
        p += v
        c = 0
    else:
        c += 1
print(p)
Buggy python submission (verdict: Time Limit Exceeded):
input()
get_data = input().split(' ')  # String
default = 1
dup_list = list()
for v in get_data:
  if int(v) == default:
    dup_list.append(int(v))
  default += 1
 
del_count = 0
next_skip = False
for v in dup_list:
  if next_skip:
    next_skip = False
    continue
  if v+1 in dup_list:
    next_skip = True
  del_count += 1
  
print(del_count)

Fixed submission:
input()
get_data = input().split(' ')  # String
default = 1
dup_list = list()
for v in get_data:
  if int(v) == default:
    dup_list.append(int(v))
  default += 1
 
del_count = 0
next_skip = False
for v in dup_list:
  if next_skip:
    next_skip = False
    continue
  if v+1 in dup_list:
    next_skip = True
  del_count += 1
  
print(del_count)
Buggy python submission (verdict: Runtime Error):
import sys

# utils
def read_numbers():
    return [int(num) for num in sys.stdin.readline().split()]
def read_string():
    return sys.stdin.readline().rstrip('\r\n')
def list2str(*array):
    return ' '.join([str(i) for i in array])

def main(N, A):
    return N*N - A

def parse_stdin():
    # N = read_numbers()
    # data = []
    # for i in range(N):
    #    data.append(read_numbers())
    N = read_numbers()[0]
    A = read_numbers()[0]
    return N, A

def test_main():
    """run pytest stdin.py to test"""
    #assert main([1,2], 'hi') == '3 hi'
    pass

if __name__ == '__main__':
    N, A = parse_stdin()
    result = main(nums, line)
    print(result)

Fixed submission:
import sys

# utils
def read_numbers():
    return [int(num) for num in sys.stdin.readline().split()]
def read_string():
    return sys.stdin.readline().rstrip('\r\n')
def list2str(*array):
    return ' '.join([str(i) for i in array])

def main(N, A):
    return N*N - A

def parse_stdin():
    # N = read_numbers()
    # data = []
    # for i in range(N):
    #    data.append(read_numbers())
    N = read_numbers()[0]
    A = read_numbers()[0]
    return N, A

def test_main():
    """run pytest stdin.py to test"""
    #assert main([1,2], 'hi') == '3 hi'
    pass

if __name__ == '__main__':
    N, A = parse_stdin()
    result = main(N, A)
    print(result)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
B = set()
C = []
for i in A:
    if 1<= i <= 399:
        B.add("grey")
    elif 400 <= i <= 799:
        B.add("brown")
    elif 800 <= i <= 1199:
        B.add("green")
    elif 1200 <= i <= 1599:
        B.add("sky")
    elif 1600 <= i <= 1999:
        B.add("blue")
    elif 2000 <= i <= 2399:
        B.add("yellow")
    elif 2400 <= i <= 2700:
        B.add("orange")
    elif 2800 <= i <= 3199:
        B.add("red")
    else:
        C.append("X")

if C:
    S = len(B)
    if S == 0:
        S = 1
    T = len(B) + len (C)
    if T > 8:
        T = 8
    print(str(S) + " " + str(T))
else:
    print(str(len(B)) + " " + str(len(B)))

Fixed submission:
x,y,z = map(int, input().split())
S = x * 100 + y * 10 + z
if S % 4 == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
import heapq
N,A,B = map(int, input().split())
H = []
for i in range(N):
 heapq.heappush(H,  - int(input()))

cnt = 0
def atack(H):
 global cnt
 H = list(map(lambda x:x+B, H))
 h = heapq.heapreplace(H, H[0] + A - B)
 cnt += 1
 return H

while H[0] < 0:
 H = atack(H)

print(str(cnt))

Fixed submission:
A,B=map(int, input().split())
if A + B >= 10:
 print("error")
else:
 print(str(A+B))

Buggy python submission (verdict: Runtime Error):
import heapq
N,A,B = map(int, input().split())
H = []
for i in range(N):
 heapq.heappush(H,  - int(input()))

cnt = 0
def atack(H):
 global cnt
 H = list(map(lambda x:x+B, H))
 h = heapq.heapreplace(H, H[0] + A - B)
 cnt += 1
 return H

while H[0] < 0:
 H = atack(H)

print(str(cnt))

Fixed submission:
A,B=map(int, input().split())
if A + B >= 10:
 print("error")
else:
 print(str(A+B))
Buggy python submission (verdict: Runtime Error):
# N,Mの把握
l = list(map(int, input().split()))
N = l[0]
M = l[1]

#list(map(str, input().split()))をM回くりかえし、１つのリストにまとめる。

c = []
for i in range(M):
	c = c + list(map(int, input().split()))

# リストを指定の番号で検索して、項目数を返す関数
def r(x):
	y = str(c.count(x))
	return y

#都市番号1からNまでリストを検索し、出力
dic = {}
for i in range(1,N+1):
	print(r(i))

Fixed submission:
list = list(map(int, input().split()))
if list[2] >= list[0] and list[2] <= list[1]:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
#N,Tの取得
N,M = map(int, input().split())
#秒のリストを取得
tl = list(map(int, input().split()))

bt = 0 #直前のスイッチを押した時間
gt = T #秒数総和
for t in tl(1:):
    if t - bt > T:
        gt += T #スイッチオフの時はT秒追加
    else:
        gt += t - bt #スイッチがオンのとき、前回からの経過時間を加算
    bt = t

print(str(gt))

Fixed submission:
#N,Tの取得
l = list(map(int, input().split()))
N = l[0]
T = l[1]

#秒のリストを取得
tl = list(map(int, input().split()))

sw = 0 #スイッチオンオフの管理
bt = 0 #直前のスイッチを押した時間
gt = 0 #秒数総和
for i, t in enumerate(tl):
    if sw == 1 and t - bt > T:
        sw = 0 #全快スイッチを押してからT秒経過していたら、スイッチオフ
    if sw == 0:
        gt += T #スイッチオフの時はT秒追加
    else:
        gt += t - bt  #スイッチがオンのとき、前回からの経過時間を加算
    bt = t
    sw = 1 #スイッチオン。
        

print(str(gt))

Buggy python submission (verdict: Runtime Error):
#N,Tの取得
N,T = map(int, input().split()))

#秒のリストを取得
tl = list(map(int, input().split()))

bt = 0 #直前のスイッチを押した時間
gt = T #秒数総和
for t in tl(1:):
    if t - bt > T:
        gt += T #スイッチオフの時はT秒追加
    else:
        gt += t - bt #スイッチがオンのとき、前回からの経過時間を加算
    bt = t

print(str(gt))

Fixed submission:
#N,Tの取得
l = list(map(int, input().split()))
N = l[0]
T = l[1]

#秒のリストを取得
tl = list(map(int, input().split()))

sw = 0 #スイッチオンオフの管理
bt = 0 #直前のスイッチを押した時間
gt = 0 #秒数総和
for i, t in enumerate(tl):
    if sw == 1 and t - bt > T:
        sw = 0 #全快スイッチを押してからT秒経過していたら、スイッチオフ
    if sw == 0:
        gt += T #スイッチオフの時はT秒追加
    else:
        gt += t - bt  #スイッチがオンのとき、前回からの経過時間を加算
    bt = t
    sw = 1 #スイッチオン。
        

print(str(gt))
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a>b:
 print("GREATER")
elif a==b:
 print("EQUAL")
else:
 print("LESS")

Fixed submission:
s1, s2, s3 =map(str, input().split())
print(s1[0].upper() + s2[0].upper() + s3[0].upper())
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2:
        print(" ".join(s1[::-1]) +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))

Fixed submission:
x,y,z = map(int, input().split())
a = []
a.append(x)
a.append(y)
a.append(z)
a.sort()
print((a[0]+a[1]))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
char = input().split()
out = []
for x in range(0,N):
    out.append(char[x])
    out.reverse()
print(" ".join(out))

Fixed submission:
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2:
        print(" ".join(s1[::-1]) +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))

Buggy python submission (verdict: Runtime Error):
N = int(input())
char = input().split()
out = []
cnt = 0
while cnt <= N:
    out.append(char[x])
    out.reverse()
    cnt += 1
print(" ".join(out))

Fixed submission:
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2:
        print(" ".join(s1[::-1]) +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
char = input().split()
out = []
for x in range(0,N):
    out.append(char[x])
    out.reverse()
print(" ".join(out))

Fixed submission:
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2:
        print(" ".join(s1[::-1]) +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))