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

Fixed submission:
# 今日の曜日を表す文字列 Sが与えられます。
# Sは SUN,MON,TUE,WED,THU,FRI,SAT のいずれかであり、
# それぞれ日曜日、月曜日、火曜日、水曜日、木曜日、金曜日、土曜日を表します。
# 次の日曜日 (あす以降) が何日後か求めてください。

# 標準入力から曜日（S）を取得する
input_weekday = input()

# 次の日曜日はあと何日後かを計算して出力する
result = 0
if input_weekday == 'SUN':
    result = 7
elif input_weekday == 'MON':
    result = 6
elif input_weekday == 'TUE':
    result = 5
elif input_weekday == 'WED':
    result = 4
elif input_weekday == 'THU':
    result = 3
elif input_weekday == 'FRI':
    result = 2
elif input_weekday == 'SAT':
    result = 1

print(result)

Buggy submission (verdict: Runtime Error):
# 今日の曜日を表す文字列 Sが与えられます。
# Sは SUN,MON,TUE,WED,THU,FRI,SAT のいずれかであり、
# それぞれ日曜日、月曜日、火曜日、水曜日、木曜日、金曜日、土曜日を表します。
# 次の日曜日 (あす以降) が何日後か求めてください。

# 標準入力から曜日（S）を取得する
input_weekday = input()

# 次の日曜日はあと何日後かを計算して出力する
resut = 0
if input_weekday == 'SUN':
    result = 7
elif input_weekday == 'MON':
    result = 6
elif input_weekday == 'TUE':
    result = 5
elif input_weekday == 'WED':
    resut = 4
elif input_weekday == 'THU':
    result = 3
elif input_weekday == 'FRI':
    resut = 2
elif input_weekday == 'SAT':
    result = 1

print(result)

Buggy submission (verdict: Runtime Error):
# 今日の曜日を表す文字列 Sが与えられます。
# Sは SUN,MON,TUE,WED,THU,FRI,SAT のいずれかであり、
# それぞれ日曜日、月曜日、火曜日、水曜日、木曜日、金曜日、土曜日を表します。
# 次の日曜日 (あす以降) が何日後か求めてください。

# 標準入力から曜日（S）を取得する
input_weekday = input()

# 次の日曜日はあと何日後かを計算して出力する
resut = 0
if input_weekday == 'SUN':
    result = 7
elif input_weekday == 'MON':
    result = 6
elif input_weekday == 'TUE':
    result = 5
elif input_weekday == 'WED':
    resut = 4
elif input_weekday == 'THU':
    result = 3
elif input_weekday == 'FRI':
    resut = 2
elif input_weekday == 'SAT':
    result = 1

print(result)
Problem p02933 (python)

Fixed submission:
a = int(input())

s = input()

if a >= 3200:
    print(s)

elif a < 3200:
    print('red')

Buggy submission (verdict: Runtime Error):
a = int(input())

S = input()

if a >= 3200:
    print(s)

elif a < 3200:
    print('red')
Problem p03327 (python)

Fixed submission:
N = int(input())

if N < 1000:
    print('ABC')

elif 1000 <= N <= 1998:
    print('ABD')

Buggy submission (verdict: Runtime Error):
n = int(input())

s = input()

if n < 1000:
    print('ABC')

elif 1000 <= n <= 1998:
    print('ABD')

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

s = input()

if N < 1000:
    print('ABC')

elif 1000 <= N <= 1998:
    print('ABD')

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

s = input()

if N < 1000:
    print('ABC')

elif N > 999:
    print('ABD')
Problem p02676 (python)

Fixed submission:
k = int(input())
s = str(input())


if len(s) <= k:
    print(s)
else:
    s = s[:k] + '...'
    print(s)

Buggy submission (verdict: Runtime Error):
 = int(input())
s = str(input())

if len(s) <= k:
    print(s)
else:
    s = s[:k] + '...'
    print(s)
Problem p02847 (python)

Fixed submission:
S  =  input()

if S  ==  'SUN' :
    print(7)
elif  S  ==  'MON':
    print(6)
elif  S  ==  'TUE':
    print(5)
elif  S  ==  'WED':
    print(4)
elif  S  ==  'THU':
    print(3)
elif  S  ==  'FRI':
    print(2)
elif  S  ==  'SAT':
    print(1)

Buggy submission (verdict: Runtime Error):
S  =  入力（''）

もし S  ==  STR（'SUN' ）：
    プリント（7）
elif  S  ==  str（'MON'）：
    印刷（6）
elif  S  ==  str（'TUE'）：
    プリント（5）
elif  S  ==  str（'WED'）：
    プリント（4）
elif  S  ==  str（'THU'）：
    プリント（3）
elif  S  ==  str（'FRI'）：
    印刷（2）
その他：
    印刷（1）
Problem p02880 (python)

Fixed submission:
S = int(input())

for i in range(9) :
    i = i + 1
           
    if S % i == 0 and S // i <= 9:
        result = "Yes"
        break
    else :
        result = "No"
print(result)

Buggy submission (verdict: Runtime Error):
import sympy
S = int(input("入力："))

divisors = sympy.divisors(S)
#print(divisors)
n = len(divisors)

for i in range(int(n / 2+n % 2)):
    #print(divisors[i])
    if S // divisors[i] <= 9:
        result ="Yes"
    else:
        result ="No"
print(result)

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

divisors = sympy.divisors(S)
#print(divisors)
n = len(divisors)
for i in range(n):
    if S // divisors[i-1] <=9:
        result ="Yes"
    else:
        result ="No"
print(result)
Problem p02712 (python)

Fixed submission:
# 1 <= N <= 1000000
N = int(input())

total = []

# N項目までに含まれる->N項目は含まない。だからN項目は+1で外す。
for x in range(1, N+1):
    if x % 15 == 0:
        "FizzBuzz"
    elif x % 5 == 0:
        "Buzz"
    elif x % 3 == 0:
        "Fizz"
    else:
        total.append(x) #リストに加える
print(sum(total))

Buggy submission (verdict: Runtime Error):
# 1 <= N <= 1000000
N = int(input())

total = []

# N項目までに含まれる->N項目は含まない。だからN項目は+1で外す。
for x in range(1, N+1):
    if x % 15 == 0:
        "FizzBuzz"
    elif x % 5 == 0:
        "Buzz"
    elif x % 3 == 0:
        "Fizz"
    else:
        print(total)
        total.append(x) #リストに加える
print(sum(total))

Buggy submission (verdict: Runtime Error):
# 1 <= N <= 1000000
N = int(input())

total = []

# N項目までに含まれる->N項目は含まない。だからN項目は+1で外す。
for x in range(1, N+1):
    if x % 15 == 0:
        "FizzBuzz"
    elif x % 5 == 0:
        "Buzz"
    elif x % 3 == 0:
        "Fizz"
    else:
        print(total)
        total.append(x) #リストに加える
print(sum(total))
Problem p02847 (python)

Fixed submission:
#変b数のまとめの入力についてsplitとインデックスで価を特定させる

youbi = "SUN,MON,TUE,WED,THU,FRI,SAT".split(",")
a = input()
print(7 - youbi.index(a))

Buggy submission (verdict: Runtime Error):
SUN = 7
MON = 1
TUE = 2
WED = 3
THU = 4
FRI = 5
SAT = 6

A =  input()


print(7 - A)
Problem p02676 (python)

Fixed submission:
K = int(input())
S = input()
if len(str(S)) <= K:
    print(S)
else:
    print(S[:K]+'...')

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

if len(K) <= S:
    print(K)
else:
    print(K[:S]+"...")

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

if len(K) <= S:
    print(K)
else:
    print(K[:S] + "...")

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

S = int(input())

if len(K) <= S:
    print(K)


else:
    print(K[:S] + "...")

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

S = int(input())

if len(K) <= S:
    print(K)

#[:●]で文字の数の始点をできる
else:
    print(K[:S] + "...")

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

K = int(input())

if len(S) <= K:
    print(S)

#[:●]で文字の数の始点をできる
else:
    print(S[:K] + "...")
Problem p02880 (python)

Fixed submission:
N = int(input())

product = []

for i in range(1,10):
    for j in range(1,10):
        product.append(i * j)

if N in product:
    result = 'Yes'
else:
    result = 'No'

print(result)

Buggy submission (verdict: Runtime Error):
product = []

for i in range(1,10):
    for j in range(1,10):
        product.append(i * j)

if N in product:
    result = 'Yes'
else:
    result = 'No'

print(result)
Problem p02847 (python)

Fixed submission:
# 今日の曜日を表す文字列 S が与えられます。
# Sは SUN,MON,TUE,WED,THU,FRI,SAT のいずれかであり、
# それぞれ日曜日、月曜日、火曜日、水曜日、木曜日、金曜日、土曜日を表します。
# 次の日曜日 (あす以降) が何日後か求めてください。

# 入力: 入力は以下の形式で標準入力から与えられる。
# S
# 出力: 次の日曜日が何日後か出力せよ。

week = input()
if week == 'SAT':
    result = 1
elif week == 'FRI':
    result = 2
elif week == 'THU':
    result = 3
elif week == 'WED':
    result = 4
elif week == 'TUE':
    result = 5
elif week == 'MON':
    result = 6
elif week == 'SUN':
    result = 7

print(result)

Buggy submission (verdict: Runtime Error):
# 166A
# 問題文
# AtCoder 社は、毎週土曜日にコンテストを開催しています。
# コンテストには ABC と ARC の
# 2つの種類があり、毎週どちらか一方が開催されます。
# ABC が開催された次の週には ARC が開催され、ARC が行われた次の週には ABC が開催されます。
# 先週開催されたコンテストを表す文字列 Sが与えられるので、
# 今週開催されるコンテストを表す文字列を出力してください。
#
# 制約: Sは ABC または ARC
# 入力: 入力は以下の形式で標準入力から与えられる。
#  S
# 出力: 今週開催されるコンテストを表す文字列を出力せよ。

# ABC or ARC
S = input()

if S == 'ABC':
    answer = 'ARC'
elif S == 'ARC':
    answer = 'ABC'

print(answer)

Buggy submission (verdict: Runtime Error):
# 今日の曜日を表す文字列 S が与えられます。
# Sは SUN,MON,TUE,WED,THU,FRI,SAT のいずれかであり、
# それぞれ日曜日、月曜日、火曜日、水曜日、木曜日、金曜日、土曜日を表します。
# 次の日曜日 (あす以降) が何日後か求めてください。

# 入力: 入力は以下の形式で標準入力から与えられる。
# S
# 出力: 次の日曜日が何日後か出力せよ。

week = input()
if week == 'SAT':
    result = 1
elif week == 'FRI':
    result = 2
elif week == 'THU':
    result = 3
elif week == 'WED':
    result = 4
elif week == 'TUS':
    result = 5
elif week == 'MON':
    result = 6
elif week == 'SUN':
    result = 7

print(result)
Problem p02712 (python)

Fixed submission:
N = int(input())
sum=0
for i in range(1, N+1):
    if i%3!=0 and i%5!=0:
        sum += i
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
l = i for i in range(1, int(input()) + 1) if i % 3 != 0 and i % 5 != 0
s = sum(l)
print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
l = [i for i in range(1, int(input()) + 1) if i % 3 != 0 and i % 5 != 0]
s = sum(l)
print(s)

Buggy submission (verdict: Runtime Error):
term = int(input())
sum = 0
for i in range(1, N + 1):
    if i % 3 != 0 and i % 5 != 0:
        sum += i
print(sum)
Problem p02753 (python)

Fixed submission:
S = input()
print('No' if S == 'AAA' or S == 'BBB' else 'Yes')

Buggy submission (verdict: Runtime Error):
print(('Yes', 'No')[input() in 'AAA' or 'BBB'])
Problem p02847 (python)

Fixed submission:
print(['SAT','FRI','THU','WED','TUE','MON','SUN'].index(input()) + 1)

Buggy submission (verdict: Runtime Error):
if input() == 'SUN':
    print(7)
elif input() == 'MON':
    print(6)
elif input() == 'TUE':
    print(5)
elif input() == 'WED':
    print(4)
elif input() == 'THU':
    print(3)
elif input() == 'FRI':
    print(2)
else:
    print(1)
Problem p03207 (python)

Fixed submission:
total_item = int(input())
item_cost = []
for i in range(total_item):
    item_cost.append(int(input()))
print(sum(item_cost) - max(item_cost) // 2)

Buggy submission (verdict: Runtime Error):
total_item = int(input())
item_cost = []
for i in range(total_item):
    item_cost.append(int(input()))
print(sum(item_cost) - max(item_cost) // 2)v
Problem p02676 (python)

Fixed submission:
K = int(input())
S = str(input())

SK = S[0 : (K)]

if len(S) <= K:
    print(S)
else:
    print(SK + '...')

Buggy submission (verdict: Runtime Error):

# 高橋君の夏休みはN日間です。夏休みの宿題がM個出されており,i番目の宿題をやるにはAi日間かかります。
# 複数の宿題を同じ日にやることはできず、また、宿題をやる日には遊ぶことができません。
# 夏休み中に全ての宿題を終わらせるとき、最大何日間遊ぶことができますか？
# ただし、夏休み中に全ての宿題を終わらせることができないときは、かわりに -1 を出力してください。


N, M = map(int, input().split())
study_days = map(int, input().split())

# リストにM個の数字を、入力したい
# study_days_list = []
# study_days_list.append(study_days)
# print(study_days_list)

total_study_days = sum(study_days)

answer = (N - total_study_days)

if answer < 0:
    print(-1)
else:
    print(answer)
Problem p02847 (python)

Fixed submission:
# 146A
S = input()

if S == 'SUN':
    answer = (7)
elif S == 'MON':
    answer = (6)
elif S == 'TUE':
    answer = (5)
elif S == 'WED':
    answer = (4)
elif S == 'THU':
    answer = (3)
elif S == 'FRI':
    answer = (2)
elif S == 'SAT':
    answer = (1)

print(answer)

Buggy submission (verdict: Runtime Error):
# 146A
S = input()

if S == 'SUN':
    answer = (7)
elif S == 'MON':
    answer = (6)
elif S == 'TUE':
    answer = (5)
elif S == 'WED':
    answer = (4)
elif S == 'THU':
    answer = (3)
elif S == 'FRI':
    answer = (2)


print(answer)
Problem p02933 (python)

Fixed submission:
a = input()
s = input()

x = int(a)

if x >= 3200:
    answer = (s)
elif x < 3200:
    answer = ('red')

print(answer)

Buggy submission (verdict: Runtime Error):
a = input()
s = input()

if a >= 3200:
    answer = (s)
elif a < 3200:
    answer = ('red')

print(answer)
Problem p02847 (python)

Fixed submission:
#何曜日かを入力
weekday = input()
#日曜日までの日数を出力
if weekday == "SUN":
    print(7)
elif weekday == "MON":
    print(6)
elif weekday == "TUE":
    print(5)
elif weekday == "WED":
    print(4)
elif weekday == "THU":
    print(3)
elif weekday == "FRI":
    print(2)
elif weekday == "SAT":
    print(1)

Buggy submission (verdict: Runtime Error):
#何曜日かを入力
weekday = input()
#日曜日までの日数を出力
if weekday == "SUN":
    print(7)
elif weekday == "MON":
    print(6)S
elif weekday == "TUE":
    print(5)
elif weekday == "WED":
    print(4)
elif weekday == "THU":
    print(3)
elif weekday == "FRI":
    print(2)
elif weekday == "SAT":
    print(1)
Problem p02676 (python)

Fixed submission:

def ac_168b(K: int, S: str) -> str:
    if len(S) <= K:
        return S
    else:
        return S[0:K] + "..."

K = int(input())
S = input()
print(ac_168b(K, S))

Buggy submission (verdict: Runtime Error):

def ac_168b(K: int, S: str) -> str:
    if len(S) <= K:
        return S
    else:
        return S[0:K] + "..."

K = input()
S = input()
print(ac_168b(K, S))

Buggy submission (verdict: Runtime Error):

def ac_168b(K: int, S: str) -> str:
    if len(S) <= K:
        return S
    else:
        return S[0:K] + "..."
    
K = input():
S = input():
print(ac_168b(K, S))
Problem p02933 (python)

Fixed submission:
a = input()
s = input()
if a >= '3200':
    print(s)
if a < '3200':
    print('red')

Buggy submission (verdict: Runtime Error):
a, s, = map(input())

if a >= '3200':
    print(s)
if a < '3200':
    print('red')

Buggy submission (verdict: Runtime Error):
a, s, = map(input().split())

if a >= '3200':
    print(s)
if a < '3200':
    print('red')
Problem p02862 (python)

Fixed submission:
import sys

X, Y = map(int, input().split())
MOD = 10 ** 9 + 7

if (X + Y) % 3 != 0:
    print(0)
    sys.exit()

n1 = (2 * X - Y) // 3
n2 = (2 * Y - X) // 3

if n1 < 0 or n2 < 0:
    print(0)
    sys.exit()

P = 10 ** 9 + 7
N = 10 ** 6 + 5
inv_t = [0]+[1]
for i in range(2, N):
    inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

m = 10 ** 9 + 7
res = 1
for i in range(2, n1 + n2 + 1):
    res = res * i % m
for i in range(1, n2 + 1):
    res = res * inv_t[i] % m
for i in range(1, n1 + 1):
    res = res * inv_t[i] % m
print(res)

Buggy submission (verdict: Runtime Error):
from math import factorial
import sys

X, Y = map(int, input().split())
MOD = 10 ** 9 + 7

n1 = (2 * X - Y)
n2 = (2 * Y - X)

if n1 == 0 and n2 == 0:
    print(0)
    sys.exit()

if n1 % 3 != 0 or n2 % 3 != 0:
    print(0)
    sys.exit()
else:
    n1 = n1 // 3
    n2 = n2 // 3



P = 10**9 + 7
N = 333335
inv_t = [0]+[1]
for i in range(2,N):
    inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

m = 10**9+7
res = 1
for i in range(1, n1 + n2 + 1):
    res = res * i % m
for i in range(1, n2 + 1):
    res = res * inv_t[i] % m
for i in range(1, n1 + 1):
    res = res * inv_t[i] % m
print(res)

Buggy submission (verdict: Runtime Error):
from math import factorial
import sys

X, Y = map(int, input().split())
MOD = 10 ** 9 + 7

n1 = (2 * X - Y)
n2 = (2 * Y - X)

if n1 % 3 != 0 or n2 % 3 != 0:
    print(0)
    sys.exit()
else:
    n1 = n1 // 3
    n2 = n2 // 3

if n1 == 0 and n2 == 0:
    print(0)
    sys.exit()


P = 10**9 + 7
N = 333334
inv_t = [0]+[1]
for i in range(2,N):
    inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

m = 10**9+7
res = 1
for i in range(n1 + 1, n1 + n2 + 1):
    res = res * i % m
for i in range(1, n1 + 1):
    res = res * inv_t[i] % m
print(res)
Problem p02891 (python)

Fixed submission:
import sys
S = input()
K = int(input())

if len(set(S)) == 1:
    print((len(S) * K) // 2)
    sys.exit()

if S[-1] == S[0]:
    letter = S[0]
    i = 1
    left_count = 1
    while letter == S[i]:
        left_count += 1
        i += 1
    right_count = 1
    i = len(S) - 2
    while letter == S[i]:
        right_count += 1
        i -= 1

    if left_count % 2 == 1 and right_count % 2 == 1:
        ans = K - 1
    else:
        ans = 0

else:
    ans = 0
tmp_count = 1
tmp_ans = 0
for s in range(1, len(S)):
    tmp = S[s]
    if tmp == S[s - 1]:
        tmp_count += 1
        if s == len(S) - 1:
            tmp_ans += tmp_count // 2
    else:
        tmp_ans += tmp_count // 2
        tmp_count = 1
print(tmp_ans * K + ans)

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

if len(set(S)) == 1:
    print((len(S) * K) // 2)
    sys.exit()

if S[-1] == S[0]:
    letter = S[0]
    i = 1
    left_count = 1
    while letter == S[i]:
        left_count += 1
        i += 1
    right_count = 1
    i = len(S) - 2
    while letter == S[i]:
        right_count += 1
        i -= 1

    if left_count % 2 == 1 and right_count % 2 == 1:
        ans = K - 1
    else:
        ans = 0

tmp_count = 1
tmp_ans = 0
for s in range(1, len(S)):
    tmp = S[s]
    if tmp == S[s - 1]:
        tmp_count += 1
        if s == len(S) - 1:
            tmp_ans += tmp_count // 2
    else:
        tmp_ans += tmp_count // 2
        tmp_count = 1
print(tmp_ans * K + ans)

Buggy submission (verdict: Runtime Error):
import sys
string = input()
K = int(input())

if len(set(string)) == 1:
    print((K * len(string)) // 2)
    sys.exit()


f = string[0]
l = string[-1]
if f == l:
    first = 1
    for i in range(1, len(string)):
        if string[i] == f:
            first += 1
        else:
            break
    last = 1
    for i in range(len(string) - 2, 0, -1):
        if string[i] == l:
            last += 1
        else:
            break
ans = 0
final = 0
if (first + last) % 2 == 0 and first % 2 and last % 2:
    final = K - 1

string = string + '_'

count = 1
for n in range(1, len(string)):
    if string[n - 1] == string[n]:
        count += 1
    elif string[n - 1] != string[n] or n == len(string) - 1:
        if count >= 2:
            ans += (count // 2)
            #print(f'n: {n}')
            #print(count)
            #print(ans)
        count = 1
print(ans * K + final)
Problem p03012 (python)

Fixed submission:
from math import fabs
N = int(input())

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

total_list = [0] * N
for i in range(N):
    list_one = weight_list[: i + 1]
    list_two = weight_list[i + 1:]
    
    abs_diff = fabs(sum(list_one) - sum(list_two))
    
    total_list[i] = abs_diff
print(int(min(total_list)))

Buggy submission (verdict: Runtime Error):
from math import abs
N = int(input())

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

total_list = [0] * N
for i in range(N):
    list_one = weight_list[: i + 1]
    list_two = weight_list[i + 1:]
    
    abs_diff = abs(sum(list_one) - sum(list_two))
    
    total_list[i] = abs_diff
print(min(total_list))

Buggy submission (verdict: Runtime Error):
from math import abs
N = int(input())

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

total_list = [0] * N
for i in range(N):
    list_one = weight_list[: i + 1]
    list_two = weight_list[i + 1:]
    
    abs_diff = math.abs(sum(list_one) - sum(list_two))
    
    total_list[i] = abs_diff
print(min(total_list))
Problem p03017 (python)

Fixed submission:
#これが一番できたやつ

import sys
N, A, B, C, D = map(int, input().split())
S = str(input())

if D > C:
    if '##' in S[B:D] or '##' in S[A:C]:
        print('No')
    else:
        print('Yes')
elif C > D:
    if '...' in S[B - 2: D + 1] and '##' not in S[A: C]:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
N, A, B, C, D = map(int, input().split())
S = str(input())

new_D = [S_new[1: D], '#', S_new[D + 1: N]]
_ = ''.join(new_D)

import re
regex = r'##+'
matchobj = re.match(regex, _)
regex_dot = r'..+'
match_dot = re.match(regex_dot, _[D:])
if matchobj is not None and match_dot is None:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N, A, B, C, D = map(int, input().split())
S = str(input())

new_D = [S_new[1: D], '#', S_new[D + 1: N]]
_ = ''.join(new_D)

import re
regex = r'##+'
matchobj = re.match(regex, _)
regex_dot = r'..+'
match_dot = re.match(regex_dot, _[D:])
if matchobj is not None and match_dot is None:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
new_D = [S_new[1: D], '#', S_new[D + 1: N]]
_ = ''.join(new_D)

import re
regex = r'##+'
matchobj = re.match(regex, _)
regex_dot = r'..+'
match_dot = re.match(regex_dot, _[D:])
if matchobj is not None and match_dot is None:
    print('No')
else:
    print('Yes')
Problem p03042 (python)

Fixed submission:
S = str(input())

front = int(S[:2])
back = int(S[2:4])

if (front == 0 or front > 12) and back > 0 and back <= 12:
    print('YYMM')
elif front <= 12 and front > 0 and (back == 0 or back > 12):
    print('MMYY')
elif (front <= 12 and front > 0) and (back > 0 and back <= 12):
    print('AMBIGUOUS')
else:
    print('NA')

Buggy submission (verdict: Runtime Error):
S = str(input())

front = int(S[:2])
back = int(S[2:4])

if front > 12 and back > 0 and back <= 12:
    print('YYMM')
elif front <=12 and front > 0 and back > 12:
    print('MMYY')
elif front == 0 or end == 0:
    print('NA')
else:
    print('AMBIGUOUS')
Problem p03075 (python)

Fixed submission:
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
if int(e) - int(a) <= int(k):
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
if e - a > k:
  print(':(')
else:
  print('Yay')
Problem p03208 (python)

Fixed submission:
N, K = map(int, input().split())

height_list = [0] * N

for n in range(N):
    height_list[n] = int(input())
height_list = sorted(height_list, reverse=True)

diff_list = [0] * (N - K + 1)

for i in range(N - K + 1):
    diff_list[i] = height_list[i] - height_list[i + K - 1]
print(min(diff_list))

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

height_list = [0] * N

for n in range(N):
    height_list[n] = int(input())
height_list = sorted(height_list, reverse=True)

diff_list = [0] * (N - 2)

for i in range(N - 2):
    diff_list[i] = height_list[i] - height_list[i + K - 1]
print(min(diff_list))
Problem p03834 (python)

Fixed submission:
s = input().replace(',', ' ', 2)
print(s)

Buggy submission (verdict: Runtime Error):
s = input()
a, b, c = s.split(',')
print(f'{a} {b} {c}')
Problem p03042 (python)

Fixed submission:
s = input()

n1 = s[0:2]
n2 = s[2:4]

if int(n1) > 12 and int(n2) > 12:
    out_print = 'NA'

elif int(n1) <= 12 and int(n2) <= 12:
    out_print = 'AMBIGUOUS'
    if int(n1) == 0 and int(n2)!=0:
        out_print = 'YYMM'
    elif int(n1) != 0 and int(n2) == 0:
        out_print = 'MMYY'
    elif int(n1)==0 and int(n2)==0:
        out_print = 'NA'

elif int(n1) <= 12 and int(n2) >12:
    out_print = 'MMYY'
    if int(n1) == 0:
        out_print = 'NA'

elif int(n1) > 12 and int(n2) <= 12:
    out_print = 'YYMM'
    if int(n2) == 0:
        out_print = 'NA'
print(out_print)

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

n1 = s[0:2]
n2 = s[2:4]

if int(n1) > 12 and int(n2) > 12:
  out_print = 'NA'

  elif int(n1) <= 12 and int(n2) <= 12:
    out_print = 'AMBIGUOUS'
    if int(n1) == 0:
      out_print = 'YYMM'
      elif int(n2) == 0:
        out_print = 'MMYY'
        elif int(n1)==0 and int(n2)==0:
          out_print = 'NA'
          elif int(n1) <= 12 and int(n2) >12:
            out_print = 'MMYY'
            if int(n1) == 0:
              out_print = 'NA'

              elif int(n1) > 12 and int(n2) <= 12:
                out_print = 'YYMM'
                if int(n2) == 0:
                  out_print = 'NA'
                  print(out_print)

Buggy submission (verdict: Runtime Error):

s = input()

n1 = s[0:2]
n2 = s[2:4]

if int(n1) > 12 and int(n2) > 12:
    out_print = 'NA'

elif int(n1) <= 12 and int(n2) <= 12:
    out_print = 'AMBIGUOUS'
    if int(n1) == 0:
        out_print = 'YYMM'
    elif int(n2) == 0:
        out_print = 'MMYY'
    elif int(n1)==0 and int(n2)==0
        out_print = 'NA'
elif int(n1) <= 12 and int(n2) >12:
    out_print = 'MMYY'
    if int(n1) == 0:
        out_print = 'NA'

elif int(n1) > 12 and int(n2) <= 12:
    out_print = 'YYMM'
    if int(n2) == 0:
        out_print = 'NA'

print(out_print)
Problem p02777 (python)

Fixed submission:
input1 = input()
s = str(input1).split(' ')[0]
t = str(input1).split(' ')[1]
input2 = input()
a = int(str(input2).split(' ')[0])
b = int(str(input2).split(' ')[1])
u = str(input())
if s == u:
  a = a - 1
else:
  b = b - 1
print(a, ' ', b)

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = tuple(input().split())
judge = 0
for i in range(n):
  for j in range(i+1,n):
    if nums[i] == nums[j]:
      judge = 1
if judge == 0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
word = str(input())
for i in range(len(word)):
  word[i] = 'x'
print(word)

Buggy submission (verdict: Runtime Error):
s, t = input(), input()
a, b = input(), input()
u = input()
if s == t:
  a = a - 1
else:
  b = b - 1
print(a, b)