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

Fixed submission:
n,q = map(int,input().split())
s = input()
ans =[0]
j = 0
for i in range(n-1):#どこにACという連続文字列があるかを調べる
    if s[i] == "A" and s[i+1] == "C":
        j += 1
        ans.append(j)
    else:
        ans.append(j)
# print(ans)
for i in range(q):
    l,r = map(int, input().split())
    print(ans[r-1]-ans[l-1])

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
ans =[]
j = 0
for i in range(n-1):#どこにACという連続文字列があるかを調べる
    if s[i] == "A" and s[i+1] == "C":
        j += 1
        ans.append(j)
    else:
        ans.append(j)
for i in range(q):
    l,r = map(int, input().split())
    print(ans[r-2]-ans[l]+1)
Problem p03103 (python)

Fixed submission:
n,m=map(int,input().split())
a = []
b = []
ans = 0
for i in range(n):
    tempa,tempb = map(int,input().split())
    a.append(tempa)
    b.append(tempb)
test = list(zip(a,b))
test = sorted(test)
i=0
while m>0:
    if m-test[i][1] >=0:
        ans += test[i][0]*test[i][1]
        m -=test[i][1]
    else:
        ans += test[i][0]*m
        m=0
        print(ans)
        exit()
    i+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = []
b = []
ans = 0
for i in range(n):
    tempa,tempb = map(int,input().split())
    a.append(tempa)
    b.append(tempb)
test = dict(zip(a,b))
test = sorted(test.items())
# print(test)
# test_item = test.values()
# test_key = test.keys()
# print(test_item)
# print(test_key)
# for i in range(n):
#     if m-test[i][1] >=0:

i=0
while m>0:
    if m-test[i][1] >=0:
        ans += test[i][0]*test[i][1]
        m -=test[i][1]
    else:
        ans += test[i][0]*m
        m=0
        print(ans)
        exit()
    i+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = []
b = []
ans = 0
for i in range(n):
    tempa,tempb = map(int,input().split())
    a.append(tempa)
    b.append(tempb)
test = dict(zip(a,b))
test = sorted(test.items())

# test_item = test.values()
# test_key = test.keys()
# print(test_item)
# print(test_key)
# for i in range(n):
#     if m-test[i][1] >=0:

i=0
while m>0:
    if m-test[i][1] >=0:
        ans += test[i][0]*test[i][1]
        m -=test[i][1]
        i += 1
    else:
        ans += test[i][0]*m
        m=0
        print(ans)
        exit()
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = []
b = []
ans = 0
for i in range(n):
    tempa,tempb = map(int,input().split())
    a.append(tempa)
    b.append(tempb)
test = dict(zip(a,b))
test = sorted(test.items())
print(test)
# test_item = test.values()
# test_key = test.keys()
# print(test_item)
# print(test_key)
# for i in range(n):
#     if m-test[i][1] >=0:

i=0
while m>0:
    if m-test[i][1] >=0:
        ans += test[i][0]*test[i][1]
        m -=test[i][1]
        i += 1
    else:
        ans += test[i][0]*m
        m=0
        print(ans)
        exit()
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = []
b = []
ans = 0
for i in range(n):
    tempa,tempb = map(int,input().split())
    a.append(tempa)
    b.append(tempb)
test = dict(zip(a,b))
test = sorted(test.items())
# print(test)
# test_item = test.values()
# test_key = test.keys()
# print(test_item)
# print(test_key)
i=0
while m>0:
    if m-test[i][1] >=0:
        ans += test[i][0]*test[i][1]
        m -=test[i][1]
        i += 1
    else:
        ans += test[i][0]*m
        m=0
print(ans)
Problem p03149 (python)

Fixed submission:
n = list(map(int, input().split()))
if (1 in n) and (9 in n) and (7 in n) and 4 in n:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A = np.array(A)
B = np.array(B)
if np.sum(A) < np.sum(B):
    print(-1) 
else:
    sub_a_b = A-B
    p_sub = sorted(list(sub_a_b[sub_a_b>0]),reverse = True)
    # print(p_sub)  
    m_sub = list(sub_a_b[sub_a_b<0])
    max_counter = p_sub[0]
    m_sub_sum = abs(sum(m_sub))
    count = 1 + len(m_sub) 
    # print(p_sub[0:1])
    for i in range(len(p_sub)):
        if max_counter >= m_sub_sum:
            print(count)
            exit()
        else:
            max_counter += p_sub[i+1]
            count += 1
Problem p03151 (python)

Fixed submission:
import numpy as np
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A = np.array(A)
B = np.array(B)
if np.sum(A) < np.sum(B):
    print(-1) 
else:
    sub_a_b = A-B
    p_sub = sorted(list(sub_a_b[sub_a_b>0]),reverse = True)
    # print(p_sub)  
    m_sub = list(sub_a_b[sub_a_b<0])
    max_counter = p_sub[0]
    m_sub_sum = abs(sum(m_sub))
    count = len(m_sub) 
    # print(p_sub[0:1])
    # print(type(list(np.where(sub_a_b<0)[0])))
    # print(np.array([]))
    if list(np.where(sub_a_b<0)[0]) == [] :
        print(0)
        exit()
    else:
        count+=1

        for i in range(len(p_sub)):
            if max_counter >= m_sub_sum:
                print(count)
                exit()
            else:
                max_counter += p_sub[i+1]
                count += 1

Buggy submission (verdict: Runtime Error):
B = np.array(B)
if np.sum(A) < np.sum(B):
    print(-1) 
else:
    sub_a_b = A-B
    p_sub = sorted(list(sub_a_b[sub_a_b>0]),reverse = True)
    # print(p_sub)  
    m_sub = list(sub_a_b[sub_a_b<0])
    max_counter = p_sub[0]
    m_sub_sum = abs(sum(m_sub))
    count = len(m_sub) 
    # print(p_sub[0:1])
    if max_counter >= m_sub_sum:
        print(count)
    else:
        count+=1

        for i in range(len(p_sub)):
            if max_counter >= m_sub_sum:
                print(count)
                exit()
            else:
                max_counter += p_sub[i+1]
                count += 1
Problem p03206 (python)

Fixed submission:
n = int(input())
if n == 25:
    print("Christmas")
elif(n == 24):
    print("Christmas Eve")
elif(n == 23):
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
#include<stdio.h>
int main(){
	int D;
	scanf("%d",&D);
	if (D==25){
		puts("Christmas");
	}
	else if (D == 24){
		puts("Christmas Eve");
	}
	else if(D==23){
		puts("Christmas Eve Eve");
	}
	else if(D ==22){
		puts("Christmas Eve Eve Eve");
	}
}
Problem p03281 (python)

Fixed submission:
N = int(input())
if N<105:
    print(0)

else:
    ans = 0
    for i in range(105,N+1,2):
        temp = 0
        for j in range(1,i+1):
            if i%j == 0:
                temp +=1
        if temp == 8:
            ans += 1
    print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N<105:
    print(0)

else:
    ans = 0
    for i in range(105,N+1,2):
        temp = 0
        for j in range(1,i+1):
            if i%j == 0:
                temp +=1
        if temp == 8:
            ans += 1
print(ans)
Problem p03296 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.append(10**10)
counter = 1
ans = 0
for i in range(n):
    if a[i] == a[i+1]:
        counter += 1
    else:
        if counter %2 == 0 and counter != 1 :
            ans += counter/2
        elif counter %2 != 0 and counter != 1:
            ans += int(counter/2)
        counter = 1
print(int(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.append(10**10)
counter = 1
ans = 0
for i in range(n):
    if a[i] == a[i+1]:
        counter += 1
    else:
        if counter %2 == 0 and counter != 1 :
            ans += counter/2
        elif counte %2 != 0 and counter != 1:
            ans += int(counter/2)
        counter = 1
print(int(ans))

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

a = list(map(int,input().split()))
a.append(10**10)
counter = 1
ans = 0
for i in range(n):
    if a[i] == a[i+1]:
        counter += 1
    else:
        if counter %2 == 0 and counter != 1 :
            ans += counter/2
        elif counte %2 != 0 and counter != 1:
            ans += int(counter/2)
        counter = 1
print(int(ans))
Problem p03339 (python)

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

count_E = S[1:].count("E")
ans = count_E
for i in range(1,N):
    if S[i-1] == "W":
        count_E += 1
    if S[i] == "E":
        count_E -= 1
    if ans >count_E:
        ans = count_E
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
temp_count = S.count("W")
ans_min = 10**10
count_E = N-temp_count
count_W = 0 
for i in range(N):
    if S[i] == "W":
        count_E -= 1
    else:
        count_W +=1
    if ans_min > coun_E+count_W:
        ans_min =  coun_E+count_W
print(ans_min)
Problem p03379 (python)

Fixed submission:
N = int(input())
X = list(map(int,input().split()))
X_sorted = sorted(X)
X_median = (N)/2
median1 = X_sorted[int(X_median)]
median2 = X_sorted[int(X_median-1)]
for i in range(N):
    if X[i] >=median1:
        print(median2)
    else:
        print(median1)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = tuple(map(int,input().split()))
test = N/2
for i in range(len(test)):
    temp = list(X)
    temp.pop(i)
    temp = sorted(temp)
    print(temp[test-1])
Problem p03409 (python)

Fixed submission:
N = int(input())
red_point=[]
blue_point=[]
for i in range(N):
    red_point.append(list(map(int,input().split())))
for i in range(N):
    blue_point.append(list(map(int,input().split())))
red_point.sort(reverse=True)
blue_point.sort(key=lambda x:x[1])
# print(blue_point)
ans = 0
# temp = 0 
# print(red_point)
for i in range(N):
    redx,redy=red_point[i][0],red_point[i][1]
    for j in range(len(blue_point)):
        # print("({},{})".format(i,j))
        # print(blue_point)
        bluex,bluey=blue_point[j][0],blue_point[j][1]
        if redx<bluex and redy<bluey:
            # if temp<redx:
                # temp = redx
                # tempj=j   
            ans +=1
            # red_point.pop(i)
            blue_point.pop(j)
            break
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
red_point=[]
blue_point=[]
for i in range(N):
    red_point.append(list(map(int,input().split())))
for i in range(N):
    blue_point.append(list(map(int,input().split())))
red_point.sort(reverse=True)
blue_point.sort()
# print(blue_point)
ans = 0
temp = 0 
# print(red_point)
for i in range(N):
    redx,redy=red_point[i][0],red_point[i][1]
    for j in range(len(blue_point)):
        # print("({},{})".format(i,j))
        # print(blue_point)
        bluex,bluey=blue_point[j][0],blue_point[j][1]
        if redx<bluex and redy<bluey:
            if temp<redx:
                temp = redx
                tempj=j   
            ans +=1
            # red_point.pop(i)
            blue_point.pop(tempj)
            # break
print(ans)
Problem p03435 (python)

Fixed submission:
c1 = list(map(int,input().split(" ")))
c2 = list(map(int,input().split(" ")))
c3 = list(map(int,input().split(" ")))
a1 = []
a2 = []
a3 = []
b1 = []
b2 = []
b3 = []
judge1 = False
judge2 = False
judge3 = False
judge4 = False
for i in range(c1[0]+1):
    a1.append(i)
b1 = sorted(a1,reverse = True)
for i in b1:
    a2.append(c2[0]-i)
for i in b1:
    a3.append(c3[0]-i)

for i in a1:
    b2.append(c1[1]-i)
for i in a1:
    b3.append(c1[2]-i)

for i in range(len(a1)):
    if c2[1] == a2[i]+b2[i]:
        judge1 = True
    if c3[2] == a3[i]+b3[i]:
        judge2 = True
    if c2[2] == a2[i]+b3[i]:
        judge3 = True
    if c3[1] == a3[i]+b2[i]:
        judge4 = True 
if judge1 and judge2 and judge3 and judge4 :
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
c1 = list(map(int,input().split(" ")))
c2 = list(map(int,input().split(" ")))
c3 = list(map(int,input().split(" ")))
a1 = []
a2 = []
a3 = []
b1 = []
b2 = []
b3 = []
judge1 = False
judge2 = False
judge3 = False
judge4 = False
for i in range(c1[0]+1):
    a1.append(i)
b1 = sorted(a1,reverse = True)
for i in b1:
    a2.append(c2[0]-i)
for i in b1:
    a3.append(c3[0]-i)

for i in a1:
    b2.append(c1[1]-i)
for i in a1:
    b3.append(c1[2]-i)

for i in range(len(a1)):
    if c2[1] == a2[i]+b2[i]:
        judge1 = True
    if c3[2] == a3[i]+b3[i]:
        judge2 = True
    if c2[2] == a2[i]+b3[i]:
        judge3 = True
    if c3[1] == a3[i]+b2[i]:
        judge4 = True 
if judge1 and judge2 and judeg3 and judge4 :
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
c1 = list(map(int,input().split(" ")))
c2 = list(map(int,input().split(" ")))
c3 = list(map(int,input().split(" ")))
a1 = []
a2 = []
a3 = []
b1 = []
b2 = []
b3 = []
judge1 = False
judge2 = False
judge3 = False
judge4 = False
for i in range(c1[0]+1):
    a1.append(i)
b1 = sorted(a1,reverse = True)
for i in b1:
    a2.append(c2[0]-i)
for i in b1:
    a3.append(c3[0]-i)

for i in a1:
    b2.append(c1[1]-i)
for i in a1:
    b3.append(c1[2]-i)

for i in range(len(a1)):
    if c2[1] == a2[i]+b2[i]:
        judge1 = True
    if c3[2] == a3[i]+b3[i]:
        judge2 = True
    if c2[3] == a2[i]+b3[i]:
        judge3 = True
    if c3[1] == a3[i]+b2[i]:
        judge4 = True 
if judge1 and judge2 and judeg3 and judge4 :
    print("Yes")
else:
    print("No")
Problem p03471 (python)

Fixed submission:
import sys
N,Y = map(int,input().split(" "))

man_max = Y//10000

go_max = Y // 5000

sen_max = Y // 1000


for i in range(N,-1,-1):
    for j in range (N-i+1):
        if 10000*i +5000*j +1000*(N-(i+j)) == Y: 
            print(str(i)+" "+str(j) + " " + str(N-(i+j)))
            sys.exit()
print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
import sys
N,Y = map(int,input().split(" "))

man_max = Y//10000

go_max = Y // 5000

sen_max = Y // 1000

if man_max > N:
    man_max = N
if go_max > N:
    go_max = N
if sen_max > N:
    sen_max = N


if Y%10000 == 0 and Y//10000 ==N:
     print(str(N) + " " +"0 0")
     sys.exit()
if Y%5000 == 0 and Y//5000 ==N:
     print("0 " + str(N) +" 0")
     sys.exit()
if Y%1000 == 0 and Y//1000 ==N:
     print("0 0 " + str(N))
     sys.exit()

for k in range(man_max+1):
    for j in range(go_max+1):
        for i in range(sen_max+1):
            if (10000*k + 5000*j + 1000*i == Y):
                if i+j+k == N:
                    print(str(k)+" "+str(j) + " " + str(i))
                    sys.exit()
            elif(10000*k + 5000*j + 1000*i > Y):


print("-1 -1 -1")
Problem p03475 (python)

Fixed submission:
N = int(input())
C = []
S = []
F = []
for i in range(N-1):
    C_temp,S_temp,F_temp = map(int,input().split())
    C.append(C_temp)
    S.append(S_temp)
    F.append(F_temp)
ans = S[0]
for i in range(N):
    t = 0
    for j in range(i,N-1):
        if t<S[j]:
            t = S[j]
        elif t%F[j] == 0:
            pass
        else:
            t = t+F[j] -t%F[j]
        t += C[j]
    print(t)

Buggy submission (verdict: Runtime Error):
 = int(input())
C = []
S = []
F = []
for i in range(N-1):
    C_temp,S_temp,F_temp = map(int,input().split())
    C.append(C_temp)
    S.append(S_temp)
    F.append(F_temp)
ans = S[0]
for i in range(N):
    t = 0
    for j in range(i,N-1):
        if t<S[j]:
            t = S[j]
        elif t%F[j] == 0:
            pass
        else:
            t = t+F[j] -t%F[j]
        t += C[j]
    print(t)
Problem p03478 (python)

Fixed submission:
import math
N,A,B = map(int,input().split())
ans = 0
for i in range(1,N+1):
    sum_temp = sum(map(int,list(str(i))))
    if A<=sum_temp<=B:
        ans +=i
print(ans)

Buggy submission (verdict: Runtime Error):
import math
N,A,B = map(int,input().split())
# ans = 0
#N = list(str(N))
#N_len = len(N)
ans = 0
for i in range(1,int(N)+1):
    if (i < 10) and  (A <= i  and i<=B):
        ans += i
    elif 10<=i and i <100:
        list_i = list(str(i))
        if (A <= int(list_i[0])+int(list_i[1])  and int(list_i[0])+int(list_i[1])<=B):
            ans +=i
    elif 100<= i and i <1000:
        list_i = list(str(i))
        if (A <= int(list_i[0])+int(list_i[1])+int(list_i[2])  and int(list_i[0])+int(list_i[1])+int(list_i[2])<=B):
            ans +=i
    elif 1000 <=i:
        list_i = list(str(i))
        if (A <= int(list_i[0])+int(list_i[1])+int(list_i[2])+int(list_i[3])  and int(list_i[0])+int(list_i[1])+int(list_i[2])+list_i[3]<=B):
            ans +=i

print(ans)
Problem p03534 (python)

Fixed submission:
import sys
import collections
S = input()
count_dict = collections.Counter(S)
Num_A = count_dict["a"]
Num_B = count_dict["b"]
Num_C = count_dict["c"]

judge = sorted([Num_A, Num_B, Num_C])
if judge[2]-judge[0]>1:
    print('NO')
else:
    print('YES')

Buggy submission (verdict: Runtime Error):
import sys
import collections
S = input()
count_dict = collections.Counter(S)
Num_A = count_dict["a"]
Num_B = count_dict["b"]
Num_C = count_dict["c"]

judge = sorted([a, b, c])
if judge[2]-judge[0]>1:
    print('NO')
else:
    print('YES')

Buggy submission (verdict: Runtime Error):
import collections
import sys
S = input()
count_dict = collections.Counter(S)
Num_A = count_dict["a"]
Num_B = count_dict["b"]
Num_C = count_dict["c"]

s_list = {}
if Num_A !=0:
    s_list[0] ="a"
    Num_A -=1
elif Num_B != 0:
    s_list[0] ="b"
    Num_B -= 1
elif Num_C != 0:
    s_list[0] ="c"
    Num_C -= 1

if Num_A !=0 and s_list[0] !="a":
    s_list[1] ="a"
    Num_A -=1
elif Num_B != 0 and s_list[0] !="b":
    s_list[1] ="b"
    Num_B -= 1
elif Num_C != 0 and s_list[0] !="c":
    s_list[1] ="c"
    Num_C -= 1


i = 0
while Num_A + Num_B + Num_C != 0:
    if s_list[i] != "a" and s_list[i+1] != "a" and Num_A != 0:
        s_list[i+2] = "a"
        Num_A -=1
        i +=1

    elif s_list[i] != "b" and s_list[i+1] != "b" and Num_B != 0:
        s_list[i+2] = "b"
        Num_B -=1
        i +=1    
     
    elif s_list[i] != "c" and s_list[i+1] != "c" and Num_C != 0:
        s_list[i+2] = "c"
        Num_C -=1
        i +=1
    else:
        print("NO")    
        sys.exit()

print("YES")
Problem p03544 (python)

Fixed submission:
P = 10**18
A = []
A.append(2)
A.append(1)
n = int(input())
for i in range(2,100000):
    A.append((A[i-1] + A[i-2])%P)
print(A[n])

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long int ulli;
typedef long long int lli;
#define pb(a) push_back(a)
#define pbb(a) pop_back(a)  
#define ph(a) push_heap(a.begin(), a.end())
#define pph(a) pop_heap(a.begin(), a.end())
#define si set<int>
#define sl set<long>
#define sc set<char>
#define pii pair<int, int>
#define pll pair<long, long>
#define pdd pair<double, double>
#define TC(t) while(t--)
#define FORA(a,b,c) for ((a) == (b); (a) < (c); (a) ++)
#define FORB(a,b,c) for ((a) == (b); (a) <= (c); (a) ++)
#define FORC(a,b) for ((a) == (b); (a) > 0; (a)--)
#define FORD(a,b) for ((a) == (b); (a) >= 0; (a)--)                         
#define WM(a) while(a--)
#define WP(a) while(a++)
#define print(data) cout << data << endl
#define tin(a) cin >> a
#define ttin(a,b) cin >> a >> b
#define tttin(a,b,c) cin >> a >> b >> c
#define maxheap(a) make_heap(a.begin(),a.end())
#define fixp(a)  cout << fixed << setprecision(a);
#define RM(a,n) a.erase(remopricee(a.begin(), a.end(), n),a.end())
#define MOD 1000000007
ll prime[] = {2 , 3 , 5 , 7 , 11 , 13 , 17 , 19 , 23 , 29 , 31 , 37 , 41 , 43 , 47};
inline int gmx (int a, int b){
	return a > b ? a : b;
}
inline int gmm (int a, int b){
	return a < b ? a : b;
}
inline ll get_gcd(ll a, ll b){
    ll rem = 0;
    while( b != 0){
        rem = a % b;
        a = b; 
        b = rem;
    }
    return a;   
}
ll fastexp (ll base, ll exp){
	ll res = 1;
	if (exp == 0) return 1LL;
	while(exp){
		if(exp&1) res = (res*base)%MOD;
		res = (res+MOD)%MOD;
		base = (base*base)%MOD;
		base = (base+MOD)%MOD;
		exp >>= 1;
	}
	return (ll)res;
}
struct compare {
    bool operator()(const std::string& first, const std::string& second) {
        return first.size() < second.size();
    }
};
void Verdict_Check(){
	ifstream A("my_output.txt");
	ifstream B("code_output.txt");
	
	int c1=0,c2=0;
	bool WA = false;
	string str;
	while(getline(A,str)){
		c1++;
	}
	while(getline(B,str)){
		c2++;
	}
	A.close();
	B.close();
	ifstream AA("my_output.txt");
	ifstream BB("code_output.txt");
	if (c1 != c2){
		WA = true;
	}else{
		string s,ss;
		while(getline(AA,s) && getline(BB,ss)){
			if(s != ss){
				WA = true;
			}
		}
	}
	if (WA){
		cout << "Wrong answer!!!" << endl;
	}else{
		cout << "All test cases are passed!!!" << endl;
	}
	AA.close();
	BB.close();
}
int N;
ll a[86+5];
int main(){
	int A[10000];
	//freopen("a.in","r",stdin);
	//freopen("my_output.txt","a", stdout);
	clock_t tStart = clock();
	scanf("%d",&N);
	a[0] = 2LL;a[1] = 1LL;
	for (int i = 2; i <= N; i ++)a[i] = a[i-1] + a[i-2];
	printf("%lld\n",a[N]);
	//freopen("CON", "w", stdout);
	//Verdict_Check();
	// printf("Time taken: %.7fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
	return 0;
}
Problem p03071 (python)

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

print(max(a+a-1, a+b, b+b-1))

Buggy submission (verdict: Runtime Error):
a, b = int(input().split())

print(max(a+a-1, a+b-1, b+b-1))
Problem p03103 (python)

Fixed submission:
N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
A.sort()
sumcost = 0
for i in range(M):
    sumcost += A[0][0]
    A[0][1] -= 1
    if A[0][1] < 1:
        A.pop(0)

print(sumcost)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = []
for i in range(N):
    A.append(list(map(int, input().split())) for i in range(N))
A.sort()
sumcost = 0
k = 0
t = 0
while M-k>0:
    buy = min(M-k, A[t][1])
    sumcost += A[t][0]*buy
    k += buy
    t += 1


print(sumcost)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
A.sort()
sumcost = 0
k = 0
t = 0
while M-k>0:
    buy = min(M-k, A[t][0])
    sumcost += A[t][1]*buy
    k += buy
    t += 1


print(sumcost)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
A.sort()
sumcost = 0
k = 0
t = 0
while M-k>0:
    buy = min(M-k, A[t][0])
    sumcost += A[t][0]*buy
    k += buy
    t += 1


print(sumcost)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
A.sort()
sumcost = 0
k = 0
for i in range(M):
    if M-k>A[0][1]:
        sumcost += A[0][0]*A[0][1]
        k -= A[0][1]
        A.pop(0)
    else:
        sumcost += A[0][0]*(M-k)
        break

print(sumcost)
Problem p03363 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = {}
t = 0
x = 0
B[0] = 1
for i in A:
    x += i
    t += B.get(x, 0)
    B[x] = B.get(x, 0) + 1

print(t)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = [0]
t = 0
for i in range(N):
    B.append(B[i] + A[i])
 
C = set(B)
for j in C:
    z = B.count(j)
    if count > 1:
        t += z*(z-1)/2
 
print(int(t))
Problem p03386 (python)

Fixed submission:
A,B,K = map(int, input().split())
X = []
L = B-A+1
if 2*K>=L:
    for i in range(L):
        print(A+i)
else:
    for j in range(K):
        print(A+j)
    for k in range(K):
        print(B-K+1+k)

Buggy submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
X = []
L = B-A+1
if 2*K>=L:
    for i in range(L):
        print(A+i)
else:
    for j in range(K):
        print(A+i)
    for k in range(K):
        print(A-K+k)