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

Fixed submission:
from fractions import gcd

A, B, C, D = [int(x) for x in input().split(" ")]

c = (B // C) - (A // C) + int(A % C == 0)
d = (B // D) - (A // D) + int(A % D == 0)
lcm_cd = (C * D) // gcd(C, D)
cd = (B // (lcm_cd)) - (A // (lcm_cd)) + int(A % (lcm_cd) == 0)

c_or_d = c + d - cd

print((B - A + 1) - c_or_d)

Buggy submission (verdict: Runtime Error):
from math import gcd

A, B, C, D = [int(x) for x in input().split(" ")]

c = (B // C) - (A // C) + int(A % C == 0)
d = (B // D) - (A // D) + int(A % D == 0)
lcm_cd = (C * D) // gcd(C, D)
cd = (B // (lcm_cd)) - (A // (lcm_cd)) + int(A % (lcm_cd) == 0)

c_or_d = c + d - cd

print((B - A + 1) - c_or_d)

Buggy submission (verdict: Runtime Error):
A, B, C, D = [int(x) for x in input().split(" ")]

c = (B // C) - (A // C) + int(A % C == 0)
d = (B // D) - (A // D) + int(A % D == 0)
lcm_cd = (C * D) // gcd(C, D)
cd = (B // (lcm_cd)) - (A // (lcm_cd)) + int(A % (lcm_cd) == 0)

c_or_d = c + d - cd

print((B - A + 1) - c_or_d)
Problem p02996 (python)

Fixed submission:
N = int(input())
AB = [[int(x) for x in input().split(" ")] for _ in range(N)]

AB = sorted(AB, key=lambda e: e[1])

time = 0


for a, b in AB:
    time += a
    if time > b:
        print("No")
        break
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
AB = [[int(x) for x in input().split(" ")] for _ in range(N)]
AB = sorted(AB, key=lambda e: e[1])

time = 0

for i, a, b in AB:
    time += a
    if time > b:
        print("No")
        break
else:
    print("Yes")
Problem p03085 (python)

Fixed submission:
print(input().translate(str.maketrans('ATCG', 'TAGC')))

Buggy submission (verdict: Runtime Error):
N, Q = [int(x) for x in input().split(" ")]
S = input()
LR = [[int(x) for x in input().split(" ")] for _ in range(Q)]

print('\n'.join([str(S[l-1:r].count('AC')) for l, r in LR]))
Problem p02628 (python)

Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
asr = sorted(a,reverse=True)
del asr[0:n-k]
ans = sum(asr)
print(str(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
a = list(map(int,input().split()))
asr = sorted(a)
del asr[0:n-k]
ans = sum(asr)
print(str(ans))
Problem p02700 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
for v in range(1000):
    if c - v*b <= 0:
        ans = "Yes"
        break
    if a - v*d <= 0:
        ans = "No"
        break
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
for v in range(100):
    if a - v*d < 0:
        ans = "No"
        break
    if c - v*b < 0:
        ans = "Yes"
        break
print(ans)
Problem p02717 (python)

Fixed submission:
x,y,z=map(int,input().split())
print("{} {} {}".format(z,x,y))

Buggy submission (verdict: Runtime Error):
x,y,z=map(int,input().split())
print("{} {} {}".format(z,x,y)
Problem p02727 (python)

Fixed submission:
import sys
sys.setrecursionlimit(4100000)

x,y,a,b,c = map(int,input().split())
p = sorted(list(map(int,input().split())))
q = sorted(list(map(int,input().split())))
r = list(map(int,input().split()))
ans = 0

for k in range(1,x+1):
    r.append(p[-k])
for v in range(1,y+1):
    r.append(q[-v])

rs = sorted(r)

for i in range(1,x+y+1):
    ans += rs[-i]
print(str(ans))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(4100000)

x,y,a,b,c = map(int,input(),split())
p = sort(list(map(int,input(),split())))
q = sort(list(map(int,input(),split())))
r = list(map(int,input(),split()))
ans = 0

for k in range(1,x+1):
    r.append(p[-k])
for v in range(1,y+1):
    r.append(p[-v])

rs = sort(r)

for i in range(1,X+Y+1):
    ans += rs[-i]
print(str(ans))

Buggy submission (verdict: Runtime Error):
x,y,a,b,c = map(int,input(),split())
p = sort(list(map(int,input(),split())))
q = sort(list(map(int,input(),split())))
r = list(map(int,input(),split()))
ans = 0

for k in range(1,x+1):
    r.append(p[-k])
for v in range(1,y+1):
    r.append(p[-v])

rs = sort(r)

for i in range(1,X+Y+1):
    ans += rs[-i]
print(str(ans))
Problem p02696 (python)

Fixed submission:
from math import floor
A,B,N=map(int,input().split())

x=min(B-1,N)

print(floor(A*x/B)-A*floor(x/B))

Buggy submission (verdict: Runtime Error):
from math import floor
A,B,N=map(int,input().split())

x=N
result=[]
for x in reversed(range(1,N+1)):
    ans=floor(A*x/B)-A*floor(x/B)
    result.append(ans)
    if len(result) == 1:
        maxr = ans 
    if len(result) > 1 max(result) == maxr:
        pass

print(max(result))
Problem p03029 (python)

Fixed submission:
a,p=map(int,input().split())
print((a*3+p)//2)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
S=[list(map(int,input().split()))[1:] for _ in range(M)]
P=list(map(int,input().split()))
a=0
for n in range(2**N):
    s_count=0
    for j,s in enumerate(S):
        count=0
        for t in s:
            if n &(1<<t):
               count|=1<<t
        s_count^=count
        if bin(s_count).count("1")%2!=P[j]:
            break
        else:
            a+=1
print(a)
Problem p03035 (python)

Fixed submission:
age,b = map(int,input().split())	
if age<6:
  print(0)
elif age<13:
  print(b//2)
else:
  print(b)

Buggy submission (verdict: Runtime Error):
if __name__ == ‘__main__’:
  inputs=[int(line) for line in input().split(' ')]
  age,b=inputs[0],inputs[1]
  if age<6:
    print(0)
  elif age<13:
    print(b/2)
  else:
    print(b)
Problem p02767 (python)

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

res = 0

r = round(sum(x)/len(x))
for i in x:
    res += (i-r)**2
print(res)

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

res = 0
r = round(sum(x)/len(x))
for i in x:
    res +=(i-p)**2
print(res)
Problem p02789 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if(a==b):
    print("Yes")
print("No")

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
if(a==b):
    print("Yes")
print("No")
Problem p02817 (python)

Fixed submission:
the_string = raw_input()
S, T = the_string.split()
print(T.strip()+S.strip())

Buggy submission (verdict: Runtime Error):
the_string = raw_input()
S, T = the_string.split()
print(T.strip()+S.strip())

Buggy submission (verdict: Runtime Error):
the_string = raw_input()
name, age = the_string.split()
print(age+name)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
print(T+S)
Problem p02818 (python)

Fixed submission:
cookies = [int(x) for x in input().split()]
leftOver = cookies[0] - cookies[2]
takahashi = max(0, leftOver)
print(str(takahashi)+ ' ' + (str(cookies[1]) if takahashi > 0  else str(max(0,cookies[1] - abs(leftOver)))))

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())
c = int(raw_input())
for i in range(c):
    if(a!=0):
        a-1
    b-1

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
for i in range(c):
    if(a!=0):
        a-1
    b-1

Buggy submission (verdict: Runtime Error):
the_string = input()
a,b,c = the_string.split()
for i in range(c):
    while(a!=0):
        a-1
    b-1
Problem p02784 (python)

Fixed submission:
a, b = map(int, input().split())
c = list(map(int, input().split()))
if a <= sum(c):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = map(int, input().split())
if a <= c.sum():
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = map(int, input().split())
if a <= c.sum():
  print('Yes')
else:"
  print('No')
Problem p02921 (python)

Fixed submission:
s,t=input(),input()
print(sum(c is d for c,d in zip(s,t)))

Buggy submission (verdict: Runtime Error):
print(sum(c is d for c, d in input(), input()))

Buggy submission (verdict: Runtime Error):
s,t=input(),input()
print(sum(1 if c is d for c,d in zip(s,t)))

Buggy submission (verdict: Runtime Error):
s,t=input(),input()
print(sum([1 if c is d for c,d in s,t]))
Problem p02934 (python)

Fixed submission:
n = int(input())
ans = 0
lis = list(map(int, input().split()))
for i in lis:
  ans += 1 / i;
print(1 / ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(n):
  a = int(input())
  ans += 1 / a;
print(1 / ans)
Problem p02947 (python)

Fixed submission:
n = int(input())
ans = 0
dict = {}
for _ in range(n):
    s = str(''.join(sorted(list(input()))))
    try:
        ans += dict[s]
        dict[s] += 1
    except:
        dict[s] = 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
dict = {}
for _ in range(n):
    s = sorted(list(input()))
    if dict[s] == NULL:
        dict[s] = 0
    ans += dict[s]
    dict[s] += 1
print(ans)
Problem p02953 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
mx=0
for i in a:
  mx=max(mx, i)
  if mx-i>1:
    print('No')
    exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
mx=0
for i in a:
  mx=max(mx, i)
  if mx-i>1:
    print('No')
    return 0
print('Yes')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
mx=0
for i in a:
  mx=max(mx, i)
  if mx-i>1:
    print('No')
    return
print('Yes')
Problem p02971 (python)

Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
left=[0]
for i in a:
  left.append(max(left[-1],i))
right=[0]
for i in reversed(a):
  right.append(max(right[-1],i))
right.reverse()
for i in range(n):
  print(max(left[i],right[i+1]))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
left=[0]
for i in a:
  left.append(max(left[-1],i))
right=[0]
for i in reversed(a):
  right.append(max(right[-1],i))
right.reverse()
for i in range(n):
  print(max(left[i],right[n-i]))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
left=[0]
for i in a:
  left.append(max(left[-1],i))
right=[0]
for i in reversed(a):
  right.append(max(right[-1],i))
right.reverse()
for i in range(n):
  print(max(left[i],right[i+1]))
Problem p02993 (python)

Fixed submission:
s = input()
print('Bad' if True in [s[i] is s[i + 1] for i in range(3)] else 'Good')

Buggy submission (verdict: Runtime Error):
s = input()
print('Bad' if true in [s[i] is s[i + 1] for i in range(3)] else 'Good')

Buggy submission (verdict: Runtime Error):
s = input()
print('Bad' if true in [s[i] is s[i + 1] for i in 3] else 'Good')

Buggy submission (verdict: Runtime Error):
s = input()
print('Bad' if true in [s[i] is s[i + 1] for i in 3] 'Good')
Problem p02995 (python)

Fixed submission:
import fractions as f
a,b,c,d=map(int,input().split())
a-=1
l=c//f.gcd(c,d)*d
print(b-a-b//c+a//c-b//d+a//d+b//l-a//l)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d=map(int,input().split())
a-=1
l=c//math.gcd(c,d)*d
print(b-a-b//c+a//c-b//d+a//d+b//l-a//l)
Problem p03101 (python)

Fixed submission:
H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))
print((H - h)*(W - w))

Buggy submission (verdict: Runtime Error):
a,b=[map(int, input().split()) for _ in range(2)]
print((a[0]-b[0])*(a[1]-b[1]))

Buggy submission (verdict: Runtime Error):
H,W,h,w=[map(int, input().split()) for _ in range(2)]
print((H-h)*(W-w))
Problem p03105 (python)

Fixed submission:
a, b, c = list(map(int, input().split()))
print(min(b // a, c))

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define incant() cin.tie(0), ios::sync_with_stdio(false)
#define int long long
#define uint unsigned long long
#define double long double
using str = string;
template <class T> using vec = vector<T>;
template <class T> using vvec = vec<vec<T>>;
template <class T> using que = queue<T>;
template <class T> using pque = priority_queue<T>;
template <class... T> using tup = tuple<T...>;
using vint = vec<int>;
using vvint = vvec<int>;
using vstr = vec<str>;
using pint = pair<int, int>;
using vp = vec<pint>;
using tll = tup<int, int, int>;
using vt = vec<tll>;
using mint = map<int, int>;
using dict = map<str, int>;
using qint = que<int>;
using qp = que<pint>;
using pqint = pque<int>;
using pqp = pque<pint>;
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define fir first
#define sec second
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define sz(x) x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define ms(v, x) memset(v, x, sizeof(v))
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep,)(__VA_ARGS__)
#define _rev(i, n) revi(i, n, 0)
#define revi(i, a, b) for(int i = (int)(a - 1); i >= (int)(b); i--)
#define rev(...) _overload3(__VA_ARGS__, revi, _rev,)(__VA_ARGS__)
#define each(i, n) for(auto&& i: n)
#define out(x) cout << (x)
#define space() cout << " "
#define indent() cout << '\n'
#define print(x) out(x), indent()
#define debug(x) cerr << __LINE__ << ": " << #x << ": " << (x) << '\n'
#define YN(x) print((x) ? "YES" : "NO")
#define Yn(x) print((x) ? "Yes" : "No")
#define yn(x) print((x) ? "yes" : "no")
#define POS(x) print((x) ? "POSSIBLE" : "IMPOSSIBLE")
#define Pos(x) print((x) ? "Possible" : "Impossible")
#define pos(x) print((x) ? "possible" : "impossible")
const int INF = LLONG_MAX - INT_MAX, MOD = 1e9 + 7, LIMIT = 100001;
const int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
// const int dx[] = {-1, 0, 1, -1, 1, -1, 0, 1}, dy[] = {-1, -1, -1, 0, 0, 1, 1, 1};
const double EPS = 1e-9;
int gcd(int a, int b){return b == 0 ? a : gcd(b, a % b);}
int lcm(int a, int b){return a / gcd(a, b) * b;}
int factorial(int a){return a < 2 ? 1 : factorial(a - 1) * a;}
int summation(int a){return a < 1 ? 0 : (a * a + a) / 2;}
int combination(int n, int r){int res = 1; rep(i, 1, r + 1) res *= n--, res /= i; return res;}
const str alphabet = "abcdefghijklmnopqrstuvwxyz";
int a, b, c, k, n, m, x, y, z, w, h;
str s, t;

signed main(){
    incant();
    while(cin >> a >> b >> c){
        int res = 0, cnt = 0, sum = 0, mx = -INF, mn = INF;
        bool flag = true;
        print(min(c, b / a));
    }
}

Buggy submission (verdict: Runtime Error):
a, b, c = list(map(int, input().split()))
print(min(b // a, c)
Problem p03106 (python)

Fixed submission:
a, b, k = map(int, input().split())
for i in reversed(range(1, min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k -= 1
  if k is 0:
    print(i)
    exit()

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
for i in reversed(range(2, min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k--
  if k is 0:
    print(i)
    exit()

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
for i in reversed(range(min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k--
  if k is 0:
    print(i)
    exit()

Buggy submission (verdict: Runtime Error):
a, b, k = int(input().split())
for i in reversed(range(min(a, b) + 1)):
  if a%i is 0 and b%i is 0:
    k--
  if k is 0:
    print(i)
    exit()
Problem p03110 (python)

Fixed submission:
ans=0.0
n=int(input())
for i in range(n):
  a, s = input().split()
  a = float(a)
  if s=="BTC" :
    a *= 380000.0
  ans += a
print(ans)

Buggy submission (verdict: Runtime Error):
ans=0.0
n=int(input())
for i in range(n):
  a, s = input().split()
  a = double(a)
  if s=="BTC" :
    a *= 380000.0
  ans += a
print(ans)

Buggy submission (verdict: Runtime Error):
ans=0.0
for i in range(int(input()):
  a, s = input().split()
  a = double(a)
  if s=="BTC" :
    a *= 380000.0
  ans += a
print(ans)
Problem p03200 (python)

Fixed submission:
s,t,a=input(),0,0
for c in s:
  if c is 'B':
    t+=1
  else:
    a+=t
print(a)

Buggy submission (verdict: Runtime Error):
s,t,a=input(),0,0
for c in s:
  t+=1 if c is 'B' else a+=t
print(a)
Problem p03206 (python)

Fixed submission:
print("Christmas"+" Eve"*(25-int(input())))

Buggy submission (verdict: Runtime Error):
print("Christmas"+" Eve"*(25-int(input()))

Buggy submission (verdict: Runtime Error):
print("Christmas"+sum([" Eve" for _ in range(25-input())]))
Problem p03210 (python)

Fixed submission:
n = int(input())
print("YES" if n == 7 or n == 5 or n == 3 else "NO")

Buggy submission (verdict: Runtime Error):
print("YES" if n == 7 or n == 5 or n == 3 for n in [int(input())] else "NO")
Problem p03214 (python)

Fixed submission:
n = int(input())

num = list(map(int, input().split()))
ave = sum(num) / n

diff = None
for i, l in enumerate(num):
    if diff is None or abs(l - ave) < diff:
        diff = abs(l - ave)
        ans = i

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools as iter

n, k = map(int, input().split())
a = list(map(int, input().split()))

beauty_list = []
for i in range(len(a) + 1):
    for element in iter.combinations(a, i):
        beauty = sum(element)
        beauty_list.append(beauty)

max_and = 0
for combi in iter.combinations(set(beauty_list), k):
    ans = combi[0]
    for element in combi:
        ans &= element
    if ans > max_and:
        max_and = ans

print(max_and)
Problem p03219 (python)

Fixed submission:
a, b = map(int, input().split())
print(int(a + b / 2))

Buggy submission (verdict: Runtime Error):
print(int(input()) + int(input()) / 2)

Buggy submission (verdict: Runtime Error):
x, y = input().split
print(int(x) + int(y) / 2)

Buggy submission (verdict: Runtime Error):
x, y = int(input()), int(input())
print(x + y / 2)
Problem p03831 (python)

Fixed submission:
n, a, b = map(int, input().split())
ans = 0
v = list(map(int, input().split()))
for i in range(n):
  if i:
    ans += min(a * (v[i] - last), b);
  last = v[i]
print(ans)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = 0
for i in range(n):
  v = int(input())
  if i:
    ans += min(a * (v - last), b);
  last = v
print(ans)
Problem p03909 (python)

Fixed submission:
alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
a, b = map(int, input().split())
for i in range(a):
  c= input().split()
  for j in range(b):
    if c[j] == "snuke":
      print(alph[j] + str(i + 1))
      exit()

Buggy submission (verdict: Runtime Error):
alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
a, b = ap(int, input().split())
for i in range(a):
  for j in range(b):
    if input() == "snuke":
      print(alph[j] + str(i + 1))
      exit()
Problem p04019 (python)

Fixed submission:
import os
import math
import itertools
INF, MOD = float("inf"), 1e9 + 7
MAX, MIN = -INF, INF
dx1, dy1, dx2, dy2 = [-1, 0, 1, 0], [0, -1, 0, 1], [-1, 0, 1, -1, 1, -1, 0, 1], [-1, -1, -1, 0, 0, 1, 1, 1]

def get_int():
    return int(input())

def get_int_list():
    return list(map(int, input().split()))

while(True):
    try:
        s = input()
        if ('N' in s) == ('S' in s) and ('W' in s) == ('E' in s):
            print("Yes")
        else:
            print("No")
    except EOFError:
        exit()

Buggy submission (verdict: Runtime Error):
print("Yes" if ('N' in s) == ('S' in s) and ('W' in s) == ('E' in s) for s in [input()] else "No")

Buggy submission (verdict: Runtime Error):
print("Yes" if 'N' in s and 'S' in s and 'W' in s and'E' in s for s in [input()] else "No")
Problem p04030 (python)

Fixed submission:
s = input()
ans = []
for c in s:
    if c == '0':
        ans.append('0')
    elif c == '1':
        ans.append('1')
    elif len(ans):
        ans.pop(-1)
print(''.join(ans))

Buggy submission (verdict: Runtime Error):
s = input()
ans = []
for c in s:
    if c == '0':
        ans.append('0')
    elif c == '1':
        ans.append('1')
    else:
        ans.pop(-1)
print(''.join(ans))
Problem p02645 (python)

Fixed submission:
print(input()[:3])

Buggy submission (verdict: Runtime Error):
up = lambda x: x//2
n = int(input())
itm = []
for _ in range(n):
   v,w = [int(i) for i in input().split()]
   itm.append((v,w))
dplen = min(n,2**8)
dp = [ [0]*(10**5+2) for i in range(dplen+1)]
for i in range(1,dplen+1):
   for j in range(10**5+2):
      dp[i][j] = max(dp[up(i)][j], dp[i][max(0,j-1)])
      if (j >= itm[i-1][1]):
         dp[i][j] = max(dp[i][j], dp[up(i)][j-itm[i-1][1]] + itm[i-1][0])
q = int(input())
#print(dp[3][:10])
for i in range(q):
   vrt, l = [int(i) for i in input().split()]
   if vrt <= 2**8:
      print(dp[vrt][l])
      continue
   koho = []
   y = vrt
   for i in range(10):
      if y <= 2**8:
        break
      koho.append(y)
      y = up(y)
   bn = len(koho)
   mb = 2**bn
   ans = 0
   for j in range(mb):
      curv,curw = 0,0
      for k in range(bn):
         if (j >> k) & 1 :
            curv += itm[koho[k]-1][0]
            curw += itm[koho[k]-1][1]
      if curw <= l:
         curv += dp[vrt][l-curw]
         ans = max(curv)
   print(ans)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=  map(int,input(0.split()))
print(a*b)
Problem p02687 (python)

Fixed submission:
s = input()
if s == "ABC":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
s = input()
if s = "ABC":
  print("ARC")
else:
  print("ABC")
Problem p02717 (python)

Fixed submission:
x,y,z = map(int,input().split())
print(str(z)+' '+str(x) + ' ' + str(y))

Buggy submission (verdict: Runtime Error):
x,y,z = map(int,inout().split())
print(str(z)+' '+str(x) + ' ' + str(y))
Problem p02727 (python)

Fixed submission:
from collections import deque
x,y,a,b,c = map(int,input().split())
red = [int(i) for i in input().split()]
g = [int(i) for i in input().split()]
w = [int(i) for i in input().split()]
red.sort(reverse=True)
g.sort(reverse=True)
g = g[:y]
gw = g+w
gw.sort(reverse=True)
gwrui = []
rui = 0
for i in range(y+c):
    rui += gw[i]
    gwrui.append(rui)
red = red[:x]
rrui = []
rui = 0
for i in range(x):
    rui += red[i]
    rrui.append(rui)
rrui = [0] + rrui
ans = 0
oisr = 0
lgw = len(gw)
#print(red,gw,gwrui)
for i in range(0,x+1):
    temp = rrui[i]
    if x+y-i <= lgw:
        temp += gwrui[x+y-i-1]
        ans = max(ans,temp)
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
x,y,a,b,c = map(int,input().split())
red = [int(i) for i in input().split()]
g = [int(i) for i in input().split()]
w = [int(i) for i in input().split()]
red.sort(reverse=True)
g.sort(reverse=True)
g = g[:y]
gw = g+w
gw.sort(reverse=True)
gwrui = []
rui = 0
for i in range(y+c):
    rui += gw[i]
    gwrui.append(rui)
redq = deque(red[:x])
ans = 0
oisr = 0
#print(red,gw,gwrui)
for i in range(1,x+1):
    oisr += redq.popleft()
    temp = oisr
    temp += gwrui[x+y-i-1]
    ans = max(ans,temp)
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
x,y,a,b,c = map(int,input().split())
red = [int(i) for i in input().split()]
gw = [int(i) for i in input().split()] + [int(i) for i in input().split()]
red.sort()
gw.sort()
gwrui = []
rui = 0
for i in range(b+c):
    rui += gw[i]
    gwrui.append(rui)
redq = deque(red[:x])
ans = 0
oisr = 0
for i in range(1,x+1):
    oisr += redq.popleft()
    temp = oisr
    temp += gwrui[x+y-i]
    ans = max(ans,temp)
print(ans)
Problem p02818 (python)

Fixed submission:
# coding: utf-8
# Your code here!

a, b, k = map(int,input().split())
if a >= k:
    ans = [a-k,b]
elif a+b >=k:
    ans = [0,a+b-k]
else :
    ans = [0,0]
print(str(ans[0])+" "+str(ans[1]))

Buggy submission (verdict: Runtime Error):
a, b, k = map(int,input().split())
if a >= k:
    ans = [a-k,b]
else:
    ans = [0,a+b-k]
print(str(ans[0]+" "+str(ans[1])))
Problem p02854 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
l = sum(a)
b = list()
t = 0
ans = 10**10
for i in a:
    t += i
    b.append(t)
for j in b:
    x = abs(l-(2*j))
    if x < ans:
        ans = x

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
l = sum(a)
b = list()
t = 0
ans = 10**10
for i in a:
    t += i
    n.append(t)
for j in b:
    x = abs(l-(2*j))
    if x < ans:
        ans = x

print(ans)