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

Fixed submission:
def get_answer(input_list):
    so = input_list[0]
    t = input_list[1]

    s_len = len(so)

    """
    contest son
    s:5
    o:1 7+2
    n:2 7+3
    
    aabbcc abca
    a:0 0
    b:2 2
    c:4 4
    a:0 0 +6
    
    aa aaaa
    a:0
    a:1
    a:0 + 2
    a:1 + 2   
    
    aabbcc abccba
    a 0
    b 2
    c 4
    c 5
    b 2 6
    a 0 12 = 13
    """

    t_i = [-1] * len(t)
    s = so + so
    s_index = 0
    for i in range(len(t)):
        index = s.find(t[i], s_index)
        if index < 0:
            break
        index = index % s_len
        t_i[i] = index
        s_index = index + 1
        s_index = s_index % s_len

    if -1 in t_i:
        return -1


    t_len = len(t_i)
    ret = 0 #len(t_i)
    ret_i = 0
    for i in range(t_len):
        t1 = t_i[i]
        ret = t1
        if i < t_len - 1:
            t2 = t_i[i + 1]
            if t1 >= t2:
                ret_i += 1


    """
    for i in range((1000 - s_index) * s_len):
        find_flag = True
        ss = s
        for tt in t:
            ii = ss.find(tt)
            if ii < 0:
                find_flag = False
                break
            ss = ss[ii + 1:]
        if find_flag:
            ret = len(s)
            break
        s += so[s_index]
        s_index = (s_index + 1) % s_len
    """
    return ret_i * s_len + ret + 1

# b33 179
if __name__ == "__main__":
    input_list = []
    while True:
        try:
            input1 = input()
            if not input1:
                break
            if len(input1) == 0:
                break
            input_list.append(input1)
        except EOFError:
            break
    print(get_answer(input_list))

Buggy submission (verdict: Runtime Error):
def get_answer(input_list):
    so = input_list[0]
    s = so[0]
    s_index = 1
    s_len = len(so)
    t = input_list[1]
    ret = -1

    """
    """
    for i in range(1000):
        find_flag = True
        ss = s
        for tt in t:
            ii = ss.find(tt)
            if ii < 0:
                find_flag = False
                break
            ss = ss[ii + 1:]
        if find_flag:
            ret = len(s)
            break
        s += so[s_index]
        s_index = (s_index + 1) % s_len

    return ret


if __name__ == "__main__":
    input_list = []
    while True:
        try:
            input1 = input()
            if not input1:
                break
            if len(input1) == 0:
                break
            input_list.append(input1)
        except EOFError:
            break
    print(get_answer(input_list))
Problem p03605 (python)

Fixed submission:
print("Yes" if '9' in input() else "No")

Buggy submission (verdict: Runtime Error):
print("Yes" if 9 in input() else "No")
Problem p03609 (python)

Fixed submission:
a,b=map(int,input().split())
if a<b:
    print("0")
else:
    print(a-b)

Buggy submission (verdict: Runtime Error):
    a,b=map(int,input().split())
    if a<b:
        print("0")
    else:
        print(a-b)
Problem p03612 (python)

Fixed submission:
n=int(input())
array=list(map(int,input().split()))
ans=0
flag=0
for i in range(len(array)):
    if i+1==array[i]:
        if flag==0:
            ans+=1
            if(i<len(array)-1 and array[i+1]==i+2):
                flag=1
        else:
            flag=0
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
array=list(map(int,input().split()))
ans=0
flag=0
for i in range(len(array)):
    if i+1==array[i]:
        if flag==0:
            ans+=1
            if(i<len(array)-1&&array[i+1]==i+2):
                flag=1
        else:
            flag=0
print(ans)
Problem p03633 (python)

Fixed submission:
def gcd(a,b) :
    if a % b == 0 :
    	return b
    return gcd(b,a%b)
     
def lcm(a,b) :
    return a//gcd(a,b)*b
     
N = int(input())
res = 1
for i in range(N) :
    res = lcm(res, int(input()))
print(res)

Buggy submission (verdict: Runtime Error):
import fractions
import functools

n=int(input())
t=[]
for i in range(n):
	t.append(int(input()))
ans=functools.reduce(a*b//fractions.gcd(a,b),t)
print(ans)
Problem p03635 (python)

Fixed submission:
a,b=map(int,input().split())
print((a-1)*(b-1))

Buggy submission (verdict: Runtime Error):
n=int(input())
m=int(input())
print((n-1)*(m-1))
Problem p02909 (python)

Fixed submission:
s=input()
if s=='Sunny':
  print('Cloudy')
elif s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
today = input()
if today == "Sunny":
	print("Cloudy")
elif today == "Cloudy":
	print("Rainy")
elif today == "Rainy":
    print("Sunny”)

Buggy submission (verdict: Runtime Error):
today = input()
if today == "Sunny":
	print("Cloudy")
elif today == "Cloudy":
	print("Rainy")
elif today == "Rainy":
    print("Sunny”)

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

if S == 'Sunny':
	print('Cloudy')
else if S == 'Cloudy':
	print('Rainy')
else if S == 'Rainy':
	print('Sunny')

Buggy submission (verdict: Runtime Error):
S = input()
if S == 'Sunny':
  print('Cloudy')
else if S == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
S = input()
if S == 'Sunny':
  print 'Cloudy'
else if S == 'Cloudy':
  print 'Rainy'
else:
  print 'Sunny'

Buggy submission (verdict: Runtime Error):
input = S
if(input = 'Sunny'):
  print('Rainy')
else if(input = 'Cloudy'):
  print('Sunny')
else:
  print('Cloudy')

Buggy submission (verdict: Runtime Error):
input = S
if(input = 'Sunny'):
  print('Cloudy')
else if(input = 'Cloudy'):
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
input = S
if(input = 'Sunny'):
  print('Cloudy')
else if(input = 'Cloudy'):
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
input = S
if(input = 'Sunny')
  print('Cloudy')
else if(input = 'Cloudy')
  print('Rainy')
else
  print('Sunny')
Problem p02921 (python)

Fixed submission:
# Sを入力する
S = list(input())
# Lを入力する
L = list(input())
 
# 3つの要素に定義しなおす
S1 = S[0]
S2 = S[1]
S3 = S[2]
L1 = L[0]
L2 = L[1]
L3 = L[2]
 
# 全部同じ
if S1 == L1 and S2 == L2 and S3 == L3:
  print(3)
# 全部違う
elif S1 != L1 and S2 != L2 and S3 != L3:
  print(0)
# 一つだけ
elif (S1 == L1 and S2 != L2 and S3 != L3) or (S1 != L1 and S2 == L2 and S3 != L3) or (S1 != L1 and S2 != L2 and S3 == L3):
  print(1)
# その他
else:
  print(2)

Buggy submission (verdict: Runtime Error):
A_B = input().split()
print(-(-(int(A_B[1])-1)//int(A_B[0])))

Buggy submission (verdict: Runtime Error):
A_B = input().split()
print((int(A_B[1])-1)//(int(A_B[0])-1))

Buggy submission (verdict: Runtime Error):
A_B = input().split()
print((int(A_B[1])-1)//(int(A_B[0])-1))

Buggy submission (verdict: Runtime Error):
A_B = input().split()
print((int(A_B[1])-1)//(int(A_B[0])-1))

Buggy submission (verdict: Runtime Error):
A_B = input().split()
print(int(A_B[1])//(int(A_B[0])-1))

Buggy submission (verdict: Runtime Error):
# Sを入力する
S = input().split(" ")
# Lを入力する
L = input().split(" ")

# 3つの要素に定義しなおす
S1 = S[0]
S2 = S[1]
S3 = S[2]
L1 = L[0]
L2 = L[1]
L3 = L[2]

# 全部同じ
if S1 == L1 and S2 == L2  S3 == L3:
  print(3)
# 全部違う
elif S1 != L1 and S2 != L2  S3 != L3:
  print(0)
# 一つだけ
elif (S1 == L1 and S2 != L2  S3 != L3) or (S1 != L1 and S2 == L2  S3 != L3) or (S1 != L1 and S2 != L2  S3 == L3):
  print(1)
# その他
else:
  print(2)
end
Problem p02999 (python)

Fixed submission:
a, b = map(int, input().split())

def f(a, b):
    if a < b:
        return 0
    elif a >= b:
        return 10

print(f(a, b))

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

int judge(int a, int b)
{
    if(a < b)
    {
        return 0;
    }
    else if(a >= b)
    {
        return 10;
    }
    else
    {
        return 2;
    }
}

int main()
{
    int a, b;
    scanf("%i %i", &a, &b);
    int re = judge(a, b);
    printf("%i\n", re);
}

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

int judge(int a, int b)
{
    if(a < b)
    {
        return 0;
    }
    else if(a >= b)
    {
        return 10;
    }
    return 0;
}

int main()
{
    int a, b;
    scanf("%i %i", &a, &b);
    int re = judge(a, b);
    printf("%i\n", re);
}
Problem p03029 (python)

Fixed submission:
a, p = map(int, input().split())

re = int((a*3 + p) / 2)

print(re)

Buggy submission (verdict: Runtime Error):
N = int(input("店舗数"))

list = []
for i in range(N):
    s, p = input().split()
    P = 100 - int(p)
    list.append((s,P,i+1))

list.sort()

for a in list:
    print(a[2])
Problem p03071 (python)

Fixed submission:
A, B = map(int, input().split())
ans = 0

if A > B:
    ans = A + (A - 1)
elif A == B:
    ans = A + B
elif A < B:
    ans = B + (B - 1)

print(ans)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
ans = 0

if A > B:
    ans = A + (A - 1)
elif A == B:
    ans = A + B
elif A < B:
    ans = B + (B - 1)

print(ans)
Problem p03076 (python)

Fixed submission:
list_1 = []
list_2 = []
list_3 = []

for i in range(5):
    list_1.append(input())

for i in range(5):
    list_2.append(int(list_1[i]) % 10)

for i in range(5):
    if list_2[i] != 0:
        list_3.append(-(list_2[i] - 10))
    else:
        list_3.append(0)

max_num = 0
max_num_2 = 0
for i in range(5):
    if list_3[i] > max_num:
        max_num = list_3[i]
        max_num_2 = i

a1 = int(list_1.pop(max_num_2))
a2 = int(list_3.pop(max_num_2))

ans = 0

for i in range(4):
    ans += int(list_1[i])
    ans += list_3[i]

ans += a1

print(ans)

Buggy submission (verdict: Runtime Error):
list_1 = []
list_2 = []
list_3 = []

for i in range(5):
    list_1.append(input())

for i in range(5):
    list_2.append(int(list_1[i]) % 10)

for i in range(5):
    if list_2[i] != 0:
        list_3.append(-(list_2[i] - 10))
    else:
        list_3.append(0)

max_num = 0
for i in range(5):
    if list_3[i] > max_num:
        max_num = list_3[i]
        max_num_2 = i

a1 = int(list_1.pop(max_num_2))
a2 = int(list_3.pop(max_num_2))

ans = 0

for i in range(4):
    ans += int(list_1[i])
    ans += list_3[i]

ans += a1

print(ans)
Problem p02923 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))

times = []
count = 0
pos = 0

for i in range(n-1):
  if h[pos] >= h[pos+1]:
    count += 1
    pos += 1
  else:
    times.append(count)
    count = 0
    pos += 1

  times.append(count)
  
if n == 1:
  print(0)
else:
  print(max(times))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

times = []
count = 0
pos = 0

for i in range(n-1):
  if h[pos] >= h[pos+1]:
    count += 1
    pos += 1
  else:
    times.append(count)
    count = 0
    pos += 1

  times.append(count)
    
print(max(times))
Problem p02952 (python)

Fixed submission:
n = int(input())
count = 0

for i in range(1, n+1):
  if len(str(i)) % 2 == 1:
    count += 1
    
print(count)

Buggy submission (verdict: Runtime Error):
n = input()
l = len(n)
count = 0

for i in range(1, l, 2):
  count += 9 * 10 ** (i-1)

if l % 2 == 1:
  count += int(n[1:]) + 1

print(count)
Problem p02909 (python)

Fixed submission:
weather = input()

list = {'Sunny':'Cloudy', 'Cloudy':'Rainy', 'Rainy':'Sunny'}

print(list[weather])

Buggy submission (verdict: Runtime Error):
sankaNum, scoreMax, ansCnt = map(int, input().split())

score = []

for i in range(sankaNum):
    score.append(scoreMax)

for n in range(ansCnt):
    ansSanka = input()

    for k in range(sankaNum):
        if int(ansSanka) - 1 != k:
            score[k] -=  1
    
for m in range(sankaNum):

    if score[m]  > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv

list = {'Sunny':'Cloudy', 'Cloudy':'Rainy', 'Rainy':'Sunny'}

print(list[args[1]])
Problem p02911 (python)

Fixed submission:
sankaNum, scoreMax, ansCnt = map(int, input().split())

score = [scoreMax-ansCnt]*sankaNum

for _ in range(ansCnt):
    score[int(input()) - 1] +=  1

for m in range(sankaNum):

    if  score[m] > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
sankaNum, scoreMax, ansCnt = map(int, input().split())

score = [0]*sankaNum

for n in range(ansCnt):
    ansSanka = input()
    score[int(input()) - 1] +=  1
    
for m in range(sankaNum):

    if scoreMax - score[m] > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
sankaNum, scoreMax, ansCnt = input().split()

score = []

for i in int(sankaNum):
    score.append(scoreMax)



for n in ansCnt.int():
    ansSanka = input()

    isOk = False
    
    for k in sankaNum.int():
        if ansSanka - 1 != k:
            score[k] -= score[k] -1
            if score[k] < 0:
                isOk = True
    
    

if isOk:
    print('Yes')
else:
    print('No')
Problem p03160 (python)

Fixed submission:
import sys

n = int(input())
h = list(map(int, input().split()))
arr = [0]*100010

for i in range(n):
    arr[i] = h[i]

dp = [sys.maxsize]*100010
dp[0] = 0

for i in range(1, n):

    dp[i] = min(dp[i], dp[i - 1] + abs(arr[i] - arr[i - 1]))

    if i > 1:
        dp[i] = min(dp[i], dp[i - 2] + abs(arr[i] - arr[i - 2]))

print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
arr = [0]*10010

for i in range(n):
    arr[i] = h[i]

dp = [1000000]*100010
dp[0] = 0

for i in range(1, n):

    dp[i] = min(dp[i], dp[i - 1] + abs(arr[i] - arr[i - 1]))

    if i > 1:
        dp[i] = min(dp[i], dp[i - 2] + abs(arr[i] - arr[i - 2]))

print(dp[n-1])
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = map(int, input().split())
nums = list(map(int, input().split()))

diff = [0] * n

for i in range(0, n):
    diff[i] = abs(a - (t - nums[i] * 0.006))

print(diff.index(min(diff)) + 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
nums = list(map(int, input().split()))

diff = [0]*len(nums)

for i in len(nums):
    diff[i] = abs(A - (T - nums[i] * 0.006))

print(diff.index(min(diff[i])) + 1)
Problem p03000 (python)

Fixed submission:
N,X = map(int,input().split())
L = list(map(int,input().split()))

D = 0
i = 0
while D<=X and i<N+1:
  #print('   {}'.format(D))
  if i<N:
	  D += L[i]
  i += 1
print(i)

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

D = 0
i = 0
while D<=X:
  if X<D:
    break
  D += L[i-1]
  i += 1
print(i)

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

i = 0
D = 0
while D<=X:
  D += L[i]
  i += 1
print(i)
Problem p03031 (python)

Fixed submission:
N,M = map(int,input().split())
S = []
for m in range(M):
	nums = list(map(int,input().split()))
	S.append(nums[1:])
#print(S)
p = list(map(int,input().split()))
#print(p)

ans = 0
for bits in range(1<<N):
	for m in range(M):
		on = 0
		for s in S[m]:
			on += (bits>>(s-1))&1
		if (on&1) != p[m]:
			break  
	else:
		ans += 1

print(ans)

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

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

S = np.zeros((M,N),dtype=np.int64)
for m in range(M):
    tokens = input().split()
    K = int(tokens[0])
    for k in range(K):
        s = int(tokens[1+k])
        S[m,s-1] = 1 # s is 1-origin

p = [int(tk) for tk in input().split()]

ans = 0
for bits in range(1<<N):
	x = np.array([(bits>>b)&1 for b in range(N)],dtype=np.int64)
	y = S@x
	#print(y)
	for m in range(M):
		if (y[m]&1) != p[m]:
			break  
	else:
		ans += 1

print(ans)
Problem p03160 (python)

Fixed submission:

N = int(input())
h = list(map(int,input().split()))
#print(h)

dp = [0]*N
dp[0] = 0
dp[1] = abs(h[1]-h[0])
for n in range(2,N):
	step1 = abs(h[n]-h[n-1])+dp[n-1]
	step2 = abs(h[n]-h[n-2])+dp[n-2]
	dp[n] =  min(step1,step2)

ans = dp[N-1]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**4)

N = int(input())
h = list(map(int,input().split()))

memo = [-1]*N

def func(i):
  # メモのロード
  if memo[i]!=-1:
    return memo[i]
  # 初期値の部分
  if i==0:
    return 0
  elif i==1: 
    return abs(h[1]-h[0])
  # 二択の部分
  a = func(i-1)+abs(h[i]-h[i-1])
  b = func(i-2)+abs(h[i]-h[i-2])
  memo[i] = min(a,b) # メモのセーブ
  return memo[i]

print(func(N-1))

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

memo = [-1]*N

def func(i):
  # メモのロード
  if memo[i]!=-1:
    return memo[i]
  # 初期値の部分
  if i==0:
    return 0
  elif i==1: 
    return abs(h[1]-h[0])
  # 二択の部分
  a = func(i-1)+abs(h[i]-h[i-1])
  b = func(i-2)+abs(h[i]-h[i-2])
  memo[i] = min(a,b) # メモのセーブ
  return memo[i]

print(func(N-1))

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

memo = [-1]*N

def func(i):
  # メモのロード
  if memo[i]!=-1:
    return memo[i]
  # 初期値の部分
  if i==0:
    return 0
  elif i==1: 
    return abs(h[1]-h[0])
  # 二択の部分
  a = func(i-1)+abs(h[i]-h[i-1])
  b = func(i-2)+abs(h[i]-h[i-2])
  memo[i] = min(a,b) # メモのセーブ
  return memo[i]

print(func(N-1))

Buggy submission (verdict: Runtime Error):
from functools import lru_cache

N = int(input())
h = list(map(int,input().split()))
#print(h)

@lru_cache()
def func(cur):
	if cur==0:
		return 0
	elif cur==1:
		return abs(h[1]-h[0])#+func(0)
	step1 = abs(h[cur]-h[cur-1])+func(cur-1)
	step2 = abs(h[cur]-h[cur-2])+func(cur-2)
	return min(step1,step2)

ans = func(N-1)
print(ans)

Buggy submission (verdict: Runtime Error):
from functools import lru_cache

N = int(input())
h = list(map(int,input().split()))
#print(h)

@lru_cache(maxsize = 100001)
def func(cur):
	if cur==0:
		return 0
	elif cur==1:
		return abs(h[1]-h[0])#+func(0)
	step1 = abs(h[cur]-h[cur-1])+func(cur-1)
	step2 = abs(h[cur]-h[cur-2])+func(cur-2)
	return min(step1,step2)

ans = func(N-1)
print(ans)
Problem p02909 (python)

Fixed submission:
#! /usr/bin/env python3
# -*- coding:utf-8 -*-

WEATHER = ["Sunny", "Cloudy", "Rainy"]

def next_weather(s):
    return WEATHER[(WEATHER.index(s)+1)%len(WEATHER)]

def main():
    s = input()
    print(next_weather(s))

if __name__ == "__main__":
    main()

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

def attackSurvival(n, k, q, a):
    ans = []
    import collections
    c = collections.Counter(a)
    for i in range(n):
        if c[i+1] > q - k: ans.append('Yes')
        else: ans.append('No')
    return ans

def main():
    n, k, q = filter(int, input().split())
    a = []
    for _ in range(q):
        a.append(int(input()))
    attackSurvival(n, k, q, a)

if __name__ == '__main__':
    main()
Problem p02911 (python)

Fixed submission:
#! /usr/bin/env python3
# -*- coding:utf-8 -*-

def attackSurvival(n, k, q, a):
    ans = []
    import collections
    c = collections.Counter(a)
    for i in range(n):
        if c[i+1] > q - k: ans.append('Yes')
        else: ans.append('No')
    return ans

def main():
    n, k, q = map(int, input().split())
    a = []
    for _ in range(q):
        a.append(int(input()))
    for ans in attackSurvival(n, k, q, a): print(ans)

if __name__ == '__main__':
    main()

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

def attackSurvival(n, k, q, a):
    ans = []
    import collections
    c = collections.Counter(a)
    for i in range(n):
        if c[i+1] > q - k: ans.append('Yes')
        else: ans.append('No')
    return ans

def main():
    n, k, q = filter(int, input().split())
    a = []
    for _ in range(q):
        a.append(int(input()))
    attackSurvival(n, k, q, a)

if __name__ == '__main__':
    main()

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

def attackSurvival(n, k, q, a):
    ans = []
    import collections
    c = collections.Counter(a)
    for i in range(n):
        if c[i+1] > q - k: ans.append('Yes')
        else: ans.append('No')
    return ans

def main():
    n, k, q = filter(int, input().split())
    a = []
    for _ in range(q):
        a.append(int(input()))

if __name__ == '__main__':
    main()
Problem p02909 (python)

Fixed submission:
S = input()
if S == "Sunny": print("Cloudy")
if S == "Cloudy": print("Rainy")
if S == "Rainy": print("Sunny")

Buggy submission (verdict: Runtime Error):
if S == "Sunny": return "Cloudy"
if S == "Cloudy": return "Rainy"
if S == "Rainy": return "Sunny"
Problem p02909 (python)

Fixed submission:
l = ["Sunny", "Cloudy", "Rainy", 'Sunny']
print(l[l.index(input()) + 1])

Buggy submission (verdict: Runtime Error):
cur = input()
if cur == "Sunny":
  print("Cloudy")
else if cur == "Rainy":
  print("Sunny")
else:
  print("Rainy")
Problem p02909 (python)

Fixed submission:
import sys

def main():
    N = sys.stdin.readline().rstrip()
    w = ['Sunny', 'Cloudy', 'Rainy']
    i = w.index(N)
    print(w[(i+1)%3])

if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = sys.stdin.readline()
    w = ['Sunny', 'Cloudy', 'Rainy']
    i = w.index(N)
    print(w[(i+1)%3])

if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = sys.stdin.readline()
    w = ['Sunny', 'Cloudy', 'Rainy']
    i = w.index(N)
    print(w[(i+1)%3])

if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = sys.stdin.readline()
    w = ['Sunny', 'Cloudy', 'Rainy']
    i = w.index(N)
    print(w[(i+1)%3])

if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = sys.stdin.readline()
    w = ['Sunny', 'Cloudy', 'Rainy', 'Sunny']
    i = w.index(N)
    print(w[i+1])

if __name__=='__main__':
    main()
Problem p02913 (python)

Fixed submission:
import sys

def main():
    _,S = open(0).read().split()
    s1 = S[:int(len(S)*3/4)+1]

    maxLen = 0
    lenS1 = len(s1)
    for i in range(lenS1):
        for j in range(i+1+maxLen,lenS1):
            # print(s1[i:j], S[j:], j,i)
            if len(s1[i:j]) > len(S[j:]):
                break
            if s1[i:j] in S[j:]:
                maxLen = j-i
            else:
                break

    print(maxLen)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys, bisect

def main():
    _,M,*A = map(int, open(0).read().split())

    A.sort()
    for _ in range(M):
        a = int(A.pop() / 2)
        bisect.insort_left(A,a)

    print(sum(A))

if __name__=='__main__':
    main()