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

Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
C = []

for i in range(50):
    C.append(["#"] * 100)
for i in range(50):
    C.append(["."] * 100)

h = 0
w = 0
for i in range(A-1):
    C[h][w] = "."
    w += 2
    if w >= 100:
        # 端まで行ったら最初っから
        w = 0
        # 一行開けて下に書く
        h += 2

# 下から．二次元でもできる．
h = -1
w = 0

for i in range(B-1):
    C[h][w] = "#"
    w += 2
    if w >= 100:
        # 端まで行ったら最初っから
        w = 0
        # 一行開けて下に書く
        h -= 2

print(100, 100)
for i in range(100):
    print(*C[i], sep="")

Buggy submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
C = []

for i in range(50):
    C.append(["#"] * 100)
for i in range(50):
    C.append(["."] * 100)

h = 0
w = 0
for i in range(A-1):
    C[h][w] = "."
    w += 2
    if w >= 100:
        # 端まで行ったら最初っから
        w = 0
        # 一行開けて下に書く
        row += 2

# 下から．二次元でもできる．
h = -1
w = 0

for i in range(B-1):
    C[h][w] = "#"
    w += 2
    if w >= 100:
        # 端まで行ったら最初っから
        w = 0
        # 一行開けて下に書く
        h -= 2

print(100, 100)
for i in range(100):
    print(*C[i], sep="")
Problem p03408 (python)

Fixed submission:
import collections
n=int(input())
s=[str(input()) for i in range(n)]
m=int(input())
t=[str(input()) for i in range(m)]
s_s=set(s)
t_s=set(t)
#import pdb;pdb.set_trace()
s_c=collections.Counter(s)
t_c=collections.Counter(t)
a_l=[]
for i in s_c.keys():
    a_l.append(s_c[i]-t_c[i])
if max(a_l)>0:
    ans=max(a_l)
else:
    ans=0
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
n=int(input())
s=[str(input()) for i in range(n)]
m=int(input())
t=[str(input()) for i in range(m)]
s_s=set(s)
t_s=set(t)
#import pdb;pdb.set_trace()
s_c=collections.Counter(s)
t_c=collections.Counter(t)
a_l=[]
for i in s_c.keys():
    a_l.append(s_c[i]-t_c[i])
if max(a_l)>0:
    ans=max(a_l)
else:
    ans=0
print(ans)
import pdb;pdb.set_trace()
Problem p03417 (python)

Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
if N == 1 and M == 1:
    print(1)
elif N == 1:
    print(M - 2)
elif M == 1:
    print(N - 2)
else:
    print((N - 2) * (M - 2))


#A = [[0] * W for i in range(H)]
#C = ["o" * W for i in range(H)] 
#C = ["#"*(W+2)] + ["#"+C[i]+"#" for i in range(H)] + ["#"*(W+2)]
#dx = [1, 1, 0, -1, -1, -1, 0, 1]
#dy = [0, 1, 1, 1, 0, -1, -1, -1]
#
#for h in range(H):
#    for w in range(W):
#        for i in range(8):
#            if C[h+1+dx[i]][w+1+dy[i]] == "o":
#                A[h][w] += 1
#ans = 0
#for h in range(H):
#    for w in range(W):
#        if A[h][w] % 2 == 0:
#            ans += 1
#
#print(ans)

Buggy submission (verdict: Runtime Error):
elif N != 1 and M == 1:
    print(N - 2)
elif N >= 2 and M >= 2:
    print((N - 2) * (M - 2))


#A = [[0] * W for i in range(H)]
#C = ["o" * W for i in range(H)] 
#C = ["#"*(W+2)] + ["#"+C[i]+"#" for i in range(H)] + ["#"*(W+2)]
#dx = [1, 1, 0, -1, -1, -1, 0, 1]
#dy = [0, 1, 1, 1, 0, -1, -1, -1]
#
#for h in range(H):
#    for w in range(W):
#        for i in range(8):
#            if C[h+1+dx[i]][w+1+dy[i]] == "o":
#                A[h][w] += 1
#ans = 0
#for h in range(H):
#    for w in range(W):
#        if A[h][w] % 2 == 0:
#            ans += 1
#
#print(ans)

Buggy submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, W = MAP()

A = [[0] * W for i in range(H)]
C = ["o" * W for i in range(H)] 
C = ["#"*(W+2)] + ["#"+C[i]+"#" for i in range(H)] + ["#"*(W+2)]
dx = [1, 1, 0, -1, -1, -1, 0, 1]
dy = [0, 1, 1, 1, 0, -1, -1, -1]

for h in range(H):
    for w in range(W):
        for i in range(8):
            if C[h+1+dx[i]][w+1+dy[i]] == "o":
                A[h][w] += 1
ans = 0
for h in range(H):
    for w in range(W):
        if A[h][w] % 2 == 0:
            ans += 1

print(ans)
Problem p03434 (python)

Fixed submission:
#088B
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
#print(a)

player_a=[]
player_b=[]

for i in range(len(a)):
	if(i==0 or i%2==0):
		player_a.append(a[i])
	else:
		player_b.append(a[i])

sum_a=sum(player_a)
sum_b=sum(player_b)

ans=sum_a-sum_b

print(ans)

Buggy submission (verdict: Runtime Error):
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int n;
    int a[110];
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];
       

    sort(a,a+n,greater<int>());//a[0:n]
    int Alice=0;
    int Bob=0;
    for(int i=0;i<n;i++){
        if(i%2==0){//even Alice
            Alice += a[i];
        }
        else{
            Bob += a[i];
        }
    }
    cout<<Alice-Bob<<endl;

}
Problem p03435 (python)

Fixed submission:
#escape_ck_ans
c=[]
for i in range(3):
    c.append(list(map(int,input().split())))
a=[0]*3
b=[0]*3
a[0]=0#一つ固定する
a[1]=c[1][1]-c[0][1]
a[2]=c[2][2]-c[0][2]
b[0]=c[0][0]
b[1]=c[0][1]
b[2]=c[0][2]
flag=True
for i in range(3):
    for j in range(3):
        if c[i][j]!=a[i]+b[j]:
            flag=False
if flag==True:
    print("Yes")
else:
    print("No")
""" 
print("Yes") if flag(is true) else print("No")
"""

Buggy submission (verdict: Runtime Error):
#escape_ck_ans
c=[]
for i in range(3):
    c.append(list(map(int,input().split())))
a=[0]*3
b=[0]*3
a[0]=0#一つ固定する
a[1]=c[1][1]-c[0][1]
a[2]=c[2][2]-c[0][2]
b[0]=c[0][0]
b[1]=c[0][1]
b[2]=c[0][2]
flag=True
for i in range(3):
    for j in range(3):
        if c[i][j]!=a[i]+b[i]:
            flag=False
if flag=True:
    print("Yes")
else:
    print("No")
""" 
print("Yes") if flag(is true) else print("No")
"""
Problem p03470 (python)

Fixed submission:
#ABC085B
n=int(input())
l=[]
for i in range(n):
	l.append(input())
#set型のオブジェクトはコンストラクタset()でも生成できる。
#引数としてリストやタプルのようなイテラブルオブジェクトを指定すると、重複する要素が除外されて一意な値のみが要素となるsetオブジェクトが生成される。
s_l=set(l)
#s_l=sorted(s_l)
#set to list by sorted
#print(type(s_l))
ans=len(s_l)
print(ans)

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

int main(){
    int N;
    int d[110];
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>d[i];
    }
    set<int>values;
    for (int i=0;i<N;i++){
        values.insert(d[i]);
    }
    cout<<values.size()<<endl;
}
Problem p03495 (python)

Fixed submission:
import collections
n,k=map(int,input().split())
a=list(map(str,input().split()))
a_c=collections.Counter(a)
l=sorted(a_c.values())
ans=0
for i in range(len(l)-k):
    ans+=l[i]
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(str,input().split()))
a_c=collections.Counter(a)
l=sorted(a_c.values())
ans=0
for i in range(len(l)-k):
    ans+=l[i]
print(ans)
Problem p03565 (python)

Fixed submission:
S=input()
T=input()
flag=False
for i in range(len(S)-len(T)+1):
    dif=0
    same=0
    s=S[i:i+len(T)]#len(T)
    for j in range(len(T)):
        if s[j]!='?':#sが言葉の時
            if s[j]!=T[j]:
                #print("st",s[i],T[i])
                dif+=1
            else:
                same+=1
#                flag=True

        #else:#?のとき
    if dif==0:
        #dst=S.replace(s,T)
        flag=True
        memo=i#複数replace対策
    



if flag==False:
    print("UNRESTORABLE")
else:
    S=list(S)
    for i in range(len(T)):
        S[i+memo]=T[i]
    
    S=''.join(S)    
    S=S.replace('?','a')
    print(S)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
flag=False
for i in range(len(S)-len(T)+1):
    dif=0
    same=0
    s=S[i:i+len(T)]#len(T)
    for j in range(len(T)):
        if s[j]!='?':#sが言葉の時
            if s[j]!=T[j]:
                #print("st",s[i],T[i])
                dif+=1
            else:
                same+=1
#                flag=True

        #else:#?のとき
    if dif==0:
        #dst=S.replace(s,T)
        flag=True
        memo=i#複数replace対策
    


S=''.join(S)

if flag==False:
    print("UNRESTORABLE")
else:
    S=list(S)
    for i in range(len(T)):
        S[i+memo]=T[i]
    S=S.replace('?','a')
    print(S)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
flag=False
for i in range(len(S)-len(T)+1):
    dif=0
    same=0
    s=S[i:i+len(T)]#len(T)
    for j in range(len(T)):
        if s[j]!='?':#sが言葉の時
            if s[j]!=T[j]:
                #print("st",s[i],T[i])
                dif+=1
            else:
                same+=1
#                flag=True

        #else:#?のとき
    if dif==0:
        #dst=S.replace(s,T)
        flag=True
        memo=i#複数replace対策
S=list(S)
for i in range(len(T)):
    S[i+memo]=T[i]

S=''.join(S)

if flag==False:
    print("UNRESTORABLE")
else:
    S=S.replace('?','a')
    print(S)
Problem p03574 (python)

Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

h, w = MAP()

# a = [[0] * (w + 2)] * (h + 2)
s = [list(input()) for _ in range(h)]

dx = [1, 0, -1, 0, 1, -1, -1, 1]
dy = [0, 1, 0, -1, 1, 1, -1, -1]

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            continue
            # スルー
        num = 0
        for d in range(8):
            ni = i + dy[d]
            nj = j + dx[d]
            # niとnjで有効なのはsの定義域．
            # ni w 0 <= ni <= w - 1
            # nj h 0 <= nj <= h - 1
            
            if ni < 0 or h <= ni:
                continue
                # スルー
            if nj < 0 or w <= nj:
                continue
                # スールー
            if s[ni][nj] == "#":
                num += 1
        s[i][j] = str(num)
            # (num + "0")

for i in range(h):
    print("".join(s[i]))

Buggy submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

h, w = MAP()

# a = [[0] * (w + 2)] * (h + 2)
s = [list(input()) for _ in range(h)]

dx = [1, 0, -1, 0, 1, -1, -1, 1]
dy = [0, 1, 0, -1, 1, 1, -1, -1]

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            continue
            # スルー
        num = 0
        for d in range(8):
            ni = i + dy[d]
            nj = j + dx[d]
            # niとnjで有効なのはsの定義域．
            # ni w 0 <= ni <= w - 1
            # nj h 0 <= nj <= h - 1
            
            if ni < 0 or w <= ni:
                continue
                # スルー
            if nj < 0 or h <= nj:
                continue
                # スールー
            if s[ni][nj] == "#":
                num += 1
            s[i][j] = str(num)
            # (num + "0")

for i in range(h):
    print("".join(s[i]))
Problem p03605 (python)

Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = list(input())
if "9" in N:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = list(int())
if "9" in N:
    print("Yes")
else:
    print("No")
Problem p03610 (python)

Fixed submission:
s=str(input())
l_s=[]
for i in range(len(s)):
	if((i+1)%2!=0):
		l_s.append(s[i])

odd=''.join(l_s)
print(odd)

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

int main(){
	string s;
	cin>>s;
	int N=s.size();
	string ans;
	for(int i=0;i<N;i+=2) ans+=s[i];
		//in string, it means odd number
	cout<<ans<<endl;
}
Problem p03633 (python)

Fixed submission:
N=int(input())
def gcd(a,b):
    while b:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

T=[]
for i in range(N):
    T.append(int(input()))

if N==1:
    print(T[0])
else:
    a=lcm(T[0],T[1])
    for i in range(N):
        a=lcm(a,T[i])
    print(a)

Buggy submission (verdict: Runtime Error):
N=int(input())
def gcd(a,b):
    while b:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

T=[]
for i in range(N):
    T.append(int(input()))

if N==1:
    print(T[0])
else:
    a=lcm(T[0],T[1])
    for i in range(N):
        a=lcm(a,T[i])
print(a)
Problem p03695 (python)

Fixed submission:
#13:27
N = int(input())
A = list(map(int,input().split()))
ex_red = [0]*8
red_cnt = 0

for i in range(8):#0-7
    for j in range(N):
        if 400*i<=A[j] and A[j]<400*(i+1):
            ex_red[i]+=1
n = 0
for i in range(N):
    if 3200 <= A[i]:
        n += 1
not_red_color = 0
c = 0
for i in range(8):
    if ex_red[i] > 0:
        c += 1
#print(c)#soreigai_count
#print(n)#red_count

max_ans = n + c

#min_ans
if c >= 1:
    min_ans = c
elif c == 0:
    min_ans = 1
print(min_ans, max_ans)

Buggy submission (verdict: Runtime Error):
#13:27
N = int(input())
A = list(map(int,input().split()))
ex_red = [0]*8
red_cnt = 0

for i in range(8):#0-7
    for j in range(N):
        if 400*i<=A[j] and A[j]<400*(i+1):
            ex_red[i]+=1
n = 0
for i in range(N):
    if 3200 <= A[i]:
        n += 1
not_red_color = 0
c = 0
for i in range(8):
    if ex_red[i] > 0:
        c += 1
#print(c)#soreigai_count
#print(n)#red_count

max_ans = min(n + c)

#min_ans
if c >= 1:
    min_ans = c
elif c == 0:
    min_ans = 1
print(min_ans, max_ans)

Buggy submission (verdict: Runtime Error):
#13:27
N = int(input())
A = list(map(int,input().split()))
ex_red = [0]*8
red_cnt = 0

for i in range(8):#0-7
    for j in range(N):
        if 400*i<=A[j] and A[j]<400*(i+1):
            ex_red[i]+=1

for i in range(N):
    if 3200 <= A[i]:
        red_cnt += 1
not_red_color = 0
for i in range(8):
    if ex_red[i] > 0:
        not_red_color += 1
    
zero_num = 8 - not_red_color

if red_cnt<=1:
    ans = red_cnt + not_red_color
else:#red_cnt more than 2
    assign = red_cnt - 1
    if zero_num >= assign:
        ans = assign + not_red_color + 1
    else:
        ans = zero_num + not_red_colot + 1

#if red_cnt != 0:
min_ans = not_red_color

# if zero_num >= red_cnt:
#     ans = red_cnt + not_red_color
# else:
#     ans = zero_num + not_red_color

print(min_ans, ans)
Problem p03699 (python)

Fixed submission:
#14:31-
N = int(input())
s = []
for i in range(N):
    s.append(int(input()))
sum_s = sum(s)
s.sort()
if sum_s % 10 != 0:
    ans = sum_s
else:
    for i in range(N):
        if s[i] % 10 != 0:
            ans = sum_s - s[i]
            break
    else:
        ans = 0
print(ans)

Buggy submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = []
for i in range(N):
    S.append(INT())

S = sorted(S)

if ans % 10 != 0:
    print(ans)
    exit()
ans = sum(S)
for i in range(N):
    if S[i] % 10 != 0:
        ans = ans - S[i]
        print(ans)
        exit()

print(0)
Problem p03729 (python)

Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, C = S_LIST()
if A[-1] == B[0] and B[-1] == C[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, C = S_LIST()
if A[-1] == B[0] and B[-1] = C[0]:
    print("YES")
else:
    print("NO")
Problem p03760 (python)

Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a = list(input())
b = list(input())
l = []
# count = 0
while len(a) != 0 or len(b) != 0:
    # print(a.pop(0))
    if len(a) != 0:
        l.append(a.pop(0))
        # print(a.pop(0))
    if len(b) != 0:
        l.append(b.pop(0))
        # print(b.pop(0))
    # print(l)
print("".join(l))

Buggy submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a = input()
b = input()
l = []
for i in range(len(a)):
    l.append(a[i])
    l.append(b[i])
print("".join(l))

Buggy submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a = input()
b = input()
l = []
for i in range(len(a)):
    l.append(a[i])
    l.append(b[i])
print("".join(l))