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

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

for i in range(1,int(n/2)+1):
    if i == n-i:
        continue
    ct += 1

print(ct)

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

div_num = 998244353
result = 1
ct_l = []

for i in range(n):
    ct_l.append(0)

for item in l:
    ct_l[item] += 1

#print(ct_l)
prev_v = -1
curr_v = -1
e = n-1

for i, item in enumerate(ct_l):
    if i == 2:
        break
    if i == 0 and item == 1:
        pass
    else:
        e -= item
    if i == 1:
        prev_v = item

for i, item in enumerate(ct_l[2:]):
    #print(prev_v, item, e, result)
    e -= item
    if item == 0:
        break
    curr_v = item
    result *= prev_v**curr_v
    prev_v = curr_v
    #print(prev_v, curr_v, result)

if e < 0:
    print(0)
else:
    print(result%div_num)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
def main(a, b):
    if (a * b) % 2 == 0:
        print('Even')
    else:
        print('Odd')

a = int(input())
b = int(input())
main(a, b)

Buggy submission (verdict: Runtime Error):
def main(a, b):
    if (a * b) % 2 == 0:
        print('Even')
    else:
        print(Odd)

a = int(input())
b = int(input())
main(a, b)

Buggy submission (verdict: Runtime Error):
def calc(a, b):
    if (a * b) % 2 == 0:
        print('Even')
    else:
        print('Odd')
 
calc(a, b)
Problem p02801 (python)

Fixed submission:
abts = "abcdefghijklmnopqrstuvwxyz"
cin = str(input())
for i in range(len(abts)):
  if cin == abts[i]:
    print(abts[i+1])

Buggy submission (verdict: Runtime Error):
if __name__=="__main__":
    n, m = map(int, input().split())
    p, s=[], []
    for i in range(m):
        pin, sin = map(str, input().split())
        p.append(int(pin))
        s.append(sin)

    cnt_wa = 0
    cnt_ac = 0
    pfin = 0
    for i in range(m):
        if pfin < p[i]:
            if s[i]=="WA":  
                cnt_wa += 1
            else:
                cnt_ac += 1
                pfin = p[i]
                if pfin==n:
                    break
        
    print("{} {}".format(cnt_ac, cnt_wa))
Problem p02885 (python)

Fixed submission:
A,B = map(int,input().split())
ANS = A - B * 2
if ANS <= 0:
  print(0)
else:
  print(ANS)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().spllit())
if A - B * 2 < 0:
  print(0)
else:
  print(A - B * 2)
Problem p02909 (python)

Fixed submission:
arr = ['Sunny', 'Cloudy', 'Rainy']
i = input()
ind = (arr.index(i) + 1) % 3
print(arr[ind])

Buggy submission (verdict: Runtime Error):
arr = ['Sunny', 'Cloudy', 'Rainy']
in = input()
ind = (arr.index(in) + 1) % 3
print(arr[ind])
Problem p02924 (python)

Fixed submission:
N=int(input())
print(N*(N+1)//2-N)

Buggy submission (verdict: Runtime Error):
N=int(input())
import numpy as np
x = np.arange(N+1)
print(np.sum(x)-N)
Problem p02981 (python)

Fixed submission:
N,A,B = map(int, input().split())
print(min(N*A,B))

Buggy submission (verdict: Runtime Error):
N,A,B = map(int, input().split())
print(min(N*A),B)
Problem p03079 (python)

Fixed submission:
a,b,c=map(int,input().split())
print("Yes" if a == b and a == c else "No")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print("Yes" if a == b and a == c "No")
Problem p03238 (python)

Fixed submission:
N=int(input())
if N == 1:
  print("Hello World")
else:
  print(str(int(input()) + int(input())))

Buggy submission (verdict: Runtime Error):
N=int(input)
if N == 1:
  print("Hello World")
else:
  print(str(int(input()) + int(input()))
Problem p03293 (python)

Fixed submission:
ANS='No'
S=input()
T=input()
N=len(S)
for i in range(N):
  if S[i:N] + S[:i] == T:
    ANS='Yes'
    break
print(ANS)

Buggy submission (verdict: Runtime Error):
ANS='No'
S=input()
T=input()
N=len(S)
for i in range(S):
  if S[i:N] + S[:i] == T:
    ANS='Yes'
    break
print(ANS)
Problem p03352 (python)

Fixed submission:
n=int(input())
m = int(pow(n,1/2)) + 1
k = 0
for i in range(n+1):
  if n < pow(i,2):
    break
  if k <= pow(i,2):
    k = pow(i,2)  
  for z in range(3,n):
    if n < pow(i,z):
      break
    elif k <= pow(i,z):
      k = pow(i,z)
 
print(k)

Buggy submission (verdict: Runtime Error):
n=int(input())
m = int(pow(n,1/2)) + 1
k = 0
for i in range(m):
  fi n > pow(i,2):
    break
  else:
    k = pow(i,2)
print(k)
Problem p03386 (python)

Fixed submission:
a,b,k=map(int,input().split())
if b-a < k*2:
  for i in range(a,b+1):
    print(i)
else:
  for i in list(range(a,a+k)) + list(range(b-k+1,b+1)):
    print(i)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=list(range(a,b+1))
la= set(l[:k]) | set(l[-k:])
for i in (sorted(la)):
  print(i)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=list(range(a,b+1))
la= set(l[:k]+l[-k:])
for i in (sorted(la)):
  print(i)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=list(range(a,b+1))
la= set(l[:k]+l[-k:])
for i in (sorted(la)):
  print(i)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=list(range(a,b+1))
la= set(l[:k]+l[-k:])
for i in (sorted(la)):
  print(i)
Problem p03425 (python)

Fixed submission:
n=int(input())
M=['M','A','R','C','H']
S = {'M':0,'A':0,'R':0,'C':0,'H':0}
for _ in range(n):
  a = input()
  if a[0] in S:
  	S[a[0]] +=1
ANS=0
for i in range(len(M)):
  for j in range(i+1,len(M)):
    for k in range(j+1,len(M)):
      ANS += (S[M[i]] * S[M[j]]* S[M[k]])
print(ANS)

Buggy submission (verdict: Runtime Error):
n=int(input())
M=['M','A','R','C','H']
S = {'M':0,'A':0,'R':0,'C':0,'H':0}
for _ in range(n):
  a = input()
  if a[0] in S:
  	S[a[0]] +=1
ANS=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      ANS += (S[M[i]] * S[M[j]]* S[M[k]])
print(ANS)
Problem p03625 (python)

Fixed submission:
import collections
N=int(input())
L=list(map(int,input().split()))
ANS=[0,0]
c = collections.Counter(L).most_common()
    
for k,v in c:
  if v <= 1:
    break
  if v >= 4:
    ANS.append(k)
    ANS.append(k)
  else:
    ANS.append(k)

Z=sorted(ANS)
print(Z[-1]*Z[-2])

Buggy submission (verdict: Runtime Error):
iimport collections
N=int(input())
L=list(map(int,input().split()))
ANS=[0,0]
c = collections.Counter(L).most_common()
    
for k,v in c:
  if v <= 1:
    break
  if v >= 4:
    ANS.append(k)
    ANS.append(k)
  else:
    ANS.append(k)

Z=sorted(ANS)
print(Z[-1]*Z[-2])
Problem p02787 (python)

Fixed submission:
def main():
    H,N = map(int, input().split())
    weight = list(); value = list()
    for n in range(N):
        temp = input().split()
        weight.append(int(temp[0]))
        value.append(int(temp[1]))
    
    inf = float("inf")
    dp = [[inf for i in range(H+max(weight)+1)] for j in range(N+1)]
    for i in range(N+1): dp[i][0] = 0
    for i in range(N):
        for h in range(H+max(weight)+1):
            if(weight[i] <= h):
                dp[i+1][h]=min(dp[i][h-weight[i]]+value[i], dp[i+1][h-weight[i]]+value[i], dp[i][h])
            else:
                dp[i+1][h]=dp[i][h]
    res = int(min(dp[N][H:]))
    print(res)



if __name__ == "__main__":
    main()

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

def main():
    H,N = map(int, input().split())
    weight = list(); value = list()
    for n in range(N):
        temp = input().split()
        weight.append(int(temp[0]))
        value.append(int(temp[1]))
    
    inf = float("inf")
    dp = np.zeros([N+1, H+max(weight)+1])
    for i in range(N+1):
        for j in range(H+max(weight)+1):
            dp[i,j] = inf
    for i in range(N+1): dp[i,0] = 0
    for i in range(N):
        for h in range(H+max(weight)+1):
            if(weight[i] <= h):
                dp[i+1,h]=min(dp[i,h-weight[i]]+value[i], dp[i+1,h-weight[i]]+value[i], dp[i,h])
            else:
                dp[i+1,h]=dp[i,h]
    res = int(min(dp[N][H:]))
    print(res)

if __name__ == "__main__":
    main()

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

def main():
    H,N = map(int, input().split())
    weight = list(); value = list()
    for n in range(N):
        temp = input().split()
        weight.append(int(temp[0]))
        value.append(int(temp[1]))
    
    inf = float("inf")
    dp = np.zeros([N+1, H+max(weight)+1])
    for i in range(N+1):
        for j in range(H+max(weight)+1):
            dp[i,j] = inf
    for i in range(N+1): dp[i,0] = 0
    for i in range(N):
        for h in range(H+max(weight)+1):
            if(weight[i] <= h):
                dp[i+1,h]=min(dp[i,h-weight[i]]+value[i], dp[i+1,h-weight[i]]+value[i], dp[i,h])
            else:
                dp[i+1,h]=dp[i,h]
    res = int(min(dp[N][H:]))
    print(res)

if __name__ == "__main__":
    main()
Problem p03032 (python)

Fixed submission:
# coding: utf-8

import sys
import math

import array
import bisect
import collections
from collections import Counter, defaultdict
import fractions
import heapq
import re

sys.setrecursionlimit(1000000)


def array2d(dim1, dim2, init=None):
    return [[init for _ in range(dim2)] for _ in range(dim1)]

def argsort(l, reverse=False):
    return sorted(range(len(l)), key=lambda i: l[i], reverse=reverse)

def argmin(l):
    return l.index(min(l))

def YESNO(ans, yes="YES", no="NO"):
    print([no, yes][ans])

II = lambda: int(input())
MI = lambda: map(int, input().split())
MIL = lambda: list(MI())
MIT = lambda: tuple(MI())
MIS = lambda: input().split()


def get(V, n):
    if n >= len(V):
        yield V
    else:
        yield V[:n]
        for i in range(1, n):
            yield V[:n-i] + V[-i:]
        yield V[-n:]


def main():
    N, K = MI()
    V = MIL()
    ans = 0

    for i in range(max(K//2, 1), K + 1):
        # 左右からi個まで取る
        for vs in get(V, i):
            # K-i個まで、負を捨てる
            vs = sorted(vs)
            for j, v in enumerate(vs):
                if v >= 0: break
            ans = max(ans, sum(vs[min(K-i, j):]))
    return ans


if __name__ == "__main__":
    print(main())

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import sys
import math

import array
import bisect
import collections
from collections import Counter, defaultdict
import fractions
import heapq
import re

sys.setrecursionlimit(1000000)


def array2d(dim1, dim2, init=None):
    return [[init for _ in range(dim2)] for _ in range(dim1)]

def argsort(l, reverse=False):
    return sorted(range(len(l)), key=lambda i: l[i], reverse=reverse)

def argmin(l):
    return l.index(min(l))

def YESNO(ans, yes="YES", no="NO"):
    print([no, yes][ans])

II = lambda: int(input())
MI = lambda: map(int, input().split())
MIL = lambda: list(MI())
MIT = lambda: tuple(MI())
MIS = lambda: input().split()


def get(V, n):
    if n >= len(V):
        yield V
    else:
        yield V[:n]
        for i in range(1, n):
            yield V[:n-i] + V[-i:]
        yield V[-n:]


def main():
    N, K = MI()
    V = MIL()
    ans = 0

    for i in range(K//2, K + 1):
        # 左右からi個まで取る
        for vs in get(V, i):
            # K-i個まで、負を捨てる
            vs = sorted(vs)
            for j, v in enumerate(vs):
                if v >= 0: break
            ans = max(ans, sum(vs[min(K-i, j):]))
    return ans


if __name__ == "__main__":
    print(main())
Problem p03294 (python)

Fixed submission:
N=int(input())
print(sum(map(int, input().split()))-N)

Buggy submission (verdict: Runtime Error):
N=input()
print(sum(map(int, input().split()))-N)
Problem p03555 (python)

Fixed submission:
print(["NO","YES"][input().strip()[::-1]==input().strip()])

Buggy submission (verdict: Runtime Error):
print([NO,YES][input().strip()[::-1]==input().strip()])
Problem p03636 (python)

Fixed submission:
s=input()
print(s[0]+str(len(s)-2)+s[-1])

Buggy submission (verdict: Runtime Error):
s=input()
print(s[0]+(len(s)-2)+s[-1])
Problem p03662 (python)

Fixed submission:
# coding: utf-8


import sys
sys.setrecursionlimit(int(1e6))


class Graph(object):
    def __init__(self, N):
        self.N = N
        self.paths = [None] * (N + 1)
        for i in range(1, N + 1):
            self.paths[i] = set()

    def path(self, n1, n2):
        self.paths[n1].add(n2)
        self.paths[n2].add(n1)

    def dfs(self, n, f):
        # fからNへの最短経路を探す
        if n == self.N:
            return [n]
        for nn in self.paths[n]:
            if nn != f:
                path = self.dfs(nn, n)
                if path is not None:
                    path.append(n)
                    return path
        return None

    def region(self, start, block, f):
        # startからblockを経由せず行ける範囲のnode数
        s = 1
        for nn in self.paths[start]:
            if nn != f and nn != block:
                s += self.region(nn, block, start)
        return s


def main():
    N = int(input())
    graph = Graph(N)
    for i in range(N-1):
        n1, n2 = map(int, input().split())
        graph.path(n1, n2)
    path = graph.dfs(1, None)
    l = len(path)
    fb = path[l // 2]
    sb = path[l // 2 - 1]
    fr = graph.region(1, sb, None)
    sr = graph.region(N, fb, None)
    # print(fr)
    # print(sr)
    if fr > sr:
        print("Fennec")
    else:
        print("Snuke")


main()

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import collections


class Graph(object):
    def __init__(self, N):
        self.N = N
        self.paths = collections.defaultdict(set)

    def path(self, n1, n2):
        self.paths[n1].add(n2)
        self.paths[n2].add(n1)

    def dfs(self, n, f):
        # fからNへの最短経路を探す
        if n == self.N:
            return [n]
        for nn in self.paths[n]:
            if nn != f:
                path = self.dfs(nn, n)
                if path is not None:
                    path.append(n)
                    return path
        return None

    def region(self, start, block, f):
        # startからblockを経由せず行ける範囲のnode数
        s = 1
        for nn in self.paths[start]:
            if nn != f and nn != block:
                s += self.region(nn, block, start)
        return s


def main():
    N = int(input())
    graph = Graph(N)
    for i in range(N-1):
        n1, n2 = map(int, input().split())
        graph.path(n1, n2)
    path = graph.dfs(1, None)
    l = len(path)
    fb = path[l // 2]
    sb = path[l // 2 - 1]
    fr = graph.region(1, sb, None)
    sr = graph.region(N, fb, None)
    # print(fr)
    # print(sr)
    if fr > sr:
        print("Fennec")
    else:
        print("Snuke")


main()
Problem p03911 (python)

Fixed submission:
# coding: utf-8

import collections
import sys
sys.setrecursionlimit(100000)

def dfs(i):
    if visited[i] == 1:
        return
    visited[i] = 1
    for j in speakers[i]:
        if used_lang[j] == 1:
            continue
        used_lang[j] = 1
        for k in langs[j]:
            dfs(k)


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

langs = collections.defaultdict(list)
speakers = [[] for _ in range(N)]

for i in range(N):
    ls = list(map(int, input().split()))
    for j in range(1, ls[0] + 1):
        langs[ls[j]-1].append(i)
        speakers[i].append(ls[j]-1)

visited = [0] * N
used_lang = [0] * M
dfs(0)

if 0 not in visited:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import collections

def dfs(i):
    if visited[i] == 1:
        return
    visited[i] = 1
    for j in speakers[i]:
        for k in langs[j]:
            dfs(k)


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

langs = collections.defaultdict(list)
speakers = [[] for _ in range(N)]

for i in range(N):
    ls = list(map(int, input().split()))
    for j in range(1, ls[0] + 1):
        langs[ls[j]-1].append(i)
        speakers[i].append(ls[j]-1)

visited = [0] * N
dfs(0)

if 0 not in visited:
    print("YES")
else:
    print("NO")
Problem p03952 (python)

Fixed submission:
# coding: utf-8

import math
import fractions
import heapq
import collections
import re
import array
import bisect

from collections import Counter, defaultdict


II = lambda: int(input())
MI = lambda: map(int, input().split())


def main():
    N, x = MI()
    if x in [1, 2 * N - 1]:
        print("No")
        return
    print("Yes")
    if N == 2:
        print("1\n2\n3")
        return
    s = set([i for i in range(1, 2 * N)])
    a = [None] * (2 * N - 1)
    MED = N - 1
    if x == 2 * N - 2:
        l = (x - 1, x, x + 1, x - 2)
        a[MED - 1:MED + 3] = l
        for i in l:
            s.remove(i)
    else:
        l = x + 1, x, x - 1, x + 2
        a[MED - 1:MED + 3] = l
        for i in l:
            s.remove(i)
    for i in range(2 * N - 1):
        if a[i] is None:
            a[i] = s.pop()
    for i in range(2 * N - 1):
        print(a[i])


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# coding: utf-8

import math
import fractions
import heapq
import collections
import re
import array
import bisect

from collections import Counter, defaultdict


II = lambda: int(input())
MI = lambda: map(int, input().split())


def main():
    N, x = MI()
    if x in [1, 2 * N - 1]:
        print("No")
        return
    print("Yes")
    s = set([i for i in range(1, 2 * N)])
    a = [None] * (2 * N - 1)
    MED = N - 1
    if x == 2 * N - 2:
        l = (x - 1, x, x + 1, x - 2)
        a[MED - 1:MED + 3] = l
        for i in l:
            s.remove(i)
    else:
        l = x + 1, x, x - 1, x + 2
        a[MED - 1:MED + 3] = l
        for i in l:
            s.remove(i)
    for i in range(2 * N - 1):
        if a[i] is None:
            a[i] = s.pop()
    for i in range(2 * N - 1):
        print(a[i])


if __name__ == "__main__":
    main()
Problem p04012 (python)

Fixed submission:
import collections
o = "Yes"
for v in collections.Counter(input().strip()).values():
    if v % 2 != 0: o = "No"
print(o)

Buggy submission (verdict: Runtime Error):
o = "Yes"
for v in collections.Counter(input().strip()).values():
    if v % 2 != 0: o = "No"
print(o)
Problem p04033 (python)

Fixed submission:
# coding: utf-8

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect


a, b = map(int, input().split(" "))

p = "Positive"
n = "Negative"
z = "Zero"

if a > 0:
    print(p)
elif a == 0 or b == 0:
        print(z)
else:
    # a < 0
    if b >= 0:
        print(z)
    else:
        # a < 0, b < 0
        if (b - a) % 2 == 0:
            print(n)
        else:
            print(p)

Buggy submission (verdict: Runtime Error):
# coding: utf-8

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect

def eat_all(al):
    for i in range(len(al)):
        al[i] -= 1
    while True:
        if al[0] == 0:
            al.pop(0)
        else:
            break
    return al

def step(turn, a_list):
    if len(a_list) == 1:
        if a_list[0] % 2 == 0:
            return turn
        else:
            return (not turn)
    if a_list[-1] % 2 != 0:
        a_list.pop()
        return step(not turn, a_list)
    else:
        a_list = eat_all(a_list)
        a_list.pop()
        if len(a_list) == 0:
            return turn
        return step(turn, a_list)

n = int(input())
a_list = [None] * n
inputs = input().split(" ")
for i in range(n):
    a_list[i] = int(inputs[i])
a_list.sort()
win = step(1, a_list)
if win == 1:
    print("First")
else:
    print("Second")
Problem p02945 (python)

Fixed submission:
A, B = map(int, input().split())
c = A + B
d = A - B
e = A * B
f = [c, d, e]
maxvalue = c
for i in range(len(f)):
    if f[i] > maxvalue:
        maxvalue = f[i]
print(maxvalue)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
c = A + B
d = A - B
e = A * B
f = [c, d, e]
maxvalue = c
for i in range(len(f)):
    if f[i] > maxvalue:
        maxvalue = f[i]
print(maxvalue)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
c = A + B
d = A - B
e = A * B
f = [c, d, e]
maxvalue = c
for i in range(len(f)):
    if f[i] > maxvalue:
        maxvalue = f[i]
print(maxvalue)
Problem p03071 (python)

Fixed submission:
A, B = list(map(int, input().split()))
h = [2*A-1, 2*B-1, A+B]
maxvalue = 0
for i in range(len(h)):
    if h[i] >= maxvalue:
        maxvalue = h[i]
print(maxvalue)

Buggy submission (verdict: Runtime Error):
A, B = int(input())
h = [2*A-1, 2*B-1, A+B]
maxvalue = 0
for i in range(len(h)):
    if h[i] >= maxvalue:
        maxvalue = h[i]
print(maxvalue)
Problem p03109 (python)

Fixed submission:
S = str(input())
S1 = S[:4] + S[5:7] + S[8:]
S2 = int(S1)
if S2 <= 20190430:
    print("Heisei")
else:
    print("TBD")

Buggy submission (verdict: Runtime Error):
S = str(input())
S1 = S[:4] + S[5:7] + S[8:]
S2 = int(S)
if S2 <= 20190430:
    print("Heisei")
else:
    print("TBD")
Problem p03729 (python)

Fixed submission:
A, B, C = list(map(str, input().split()))
if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A, B, C = list(map(int, input().split()))
if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
    print("YES")
else:
    print("No")
Problem p03844 (python)

Fixed submission:
A, op, B = list(map(str, input().split()))
if op == "+":
    print(int(A) + int(B))
else:
    print(int(A) - int(B))

Buggy submission (verdict: Runtime Error):
A, op, B = list(map(str, input().split()))
if op == "+":
    print(A + B)
else:
    print(A - B)
Problem p02830 (python)

Fixed submission:
n = int(input())
st = str(input()).split(' ')
ans = ''
for i in range(n):
    ans += st[0][i]
    ans += st[1][i]
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
st = str(input()).split(' ')
ans = ''
for i in range(n):
    ans += st[i][0]
    ans += st[i][1]
print(ans)
Problem p03846 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ok = True
a.sort()
if n%2==0:
    for i in range(n):
        if a[i]!= i-i%2+1:
            ok = False
            break
else:
    for i in range(n):
        if a[i]!= i+i%2:
            ok = False
            break
if ok:
    print(2**(n//2)%(10**9+7))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
ok = True
a.sort()
if n%2==0:
    for i in range(n):
        if a[i]!= i-i%2+1:
            ok = False
            break
else:
    for i in range(n):
        if a[i]!= i+i%2:
            ok = False
            break
if ok:
    print(2**(n//2)%(10**9+7))
else:
    print(0)
Problem p02795 (python)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())
ha = h
wa = w
count = 1
if(h >= w):
    while(n > ha):
        ha += h
        count += 1
    print(count)
else:
    while(n > wa):
        wa += w
        count += 1
    print(count)

Buggy submission (verdict: Runtime Error):
h = int(input())
w = int(input())
n = int(input())
count = 0
if(h >= w):
    while(n > h):
    n -= h
    count += 1
print(count)
else:
    while(n > w):
    n -= w
    count += 1
print(count)
Problem p02983 (python)

Fixed submission:
L,R = map(int,input().split())
min = L*(L+1)%2019
a = L
b = L +1
if(R > L + 2019):
    R = L + 2019
for i in range(L,R+1):
    for j in range(i+1,R+1):
        if(i<j):
            if(min > (i*j)%2019):
                min = (i*j)%2019
                a = i
                b = j
        if(min == 0):
            break
    if(min==0):
        break
print(min)

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split())
min = L*(L+1)%2019
for i in range(L,L+2019):
    for j in range(i+1,L+2019):
        if(i<j):
            if(min > (i*j)%2019):
                min = (i*j)%2019
        if(min == 0):
            break
    if(min==0)
        break
print(min)