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

Fixed submission:
## 2 * 100000 % 1000000007 の高速計算法がわからずOUT

n = int(input())
lst = [int(e) for e in input().split(' ')]

lst = sorted(lst)
result = 1

valid_list = []
if n % 2 == 1:
    # 奇数
    valid_list.append(0)
    for i in range(1, int((n + 1) / 2)):
        valid_list.append(i * 2)
        valid_list.append(i * 2)
    if lst == valid_list:
        for i in range(int((n - 1) / 2)):
            result = (result * 2) % 1000000007
        print(int(result))
    else:
        print(0)
else:
    for i in range(1, int((n / 2) + 1)):
        valid_list.append((i * 2) - 1)
        valid_list.append((i * 2) - 1)
    if lst == valid_list:
        for i in range(int(n / 2)):
            result = (result * 2) % 1000000007
        print(int(result))
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = [int(e) for e in input().split(' ')]

lst = sorted(lst)

valid_list = []
if n % 2 == 1:
    # 奇数
    valid_list.append(0)
    for i in range(1, int((n + 1) / 2)):
        valid_list.append(i * 2)
        valid_list.append(i * 2)
    if lst == valid_list:
        print(int(2 ** (((n - 1) / 2)) % 1000000007))
    else:
        print(0)
else:
    for i in range(1, int((n / 2) + 1)):
        valid_list.append((i * 2) - 1)
        valid_list.append((i * 2) - 1)
    if lst == valid_list:
        print(int(2 ** ((n / 2)) % 1000000007))
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = [int(e) for e in input().split(' ')]

lst = sorted(lst)

valid_list = []
if n % 2 == 1:
    # 奇数
    valid_list.append(0)
    for i in range(1, int((n + 1) / 2)):
        valid_list.append(i * 2)
        valid_list.append(i * 2)
    if lst == valid_list:
        print((2 ** (((n - 1) / 2) / 5) % 1000000007) ** 5 % 1000000007)
    else:
        print(0)
else:
    for i in range(1, int((n / 2) + 1)):
        valid_list.append((i * 2) - 1)
        valid_list.append((i * 2) - 1)
    if lst == valid_list:
        print(int(2 ** ((n / 2) / 5) % 1000000007) ** 5 % 1000000007)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = [int(e) for e in input().split(' ')]

lst = sorted(lst)

valid_list = []
if n % 2 == 1:
    # 奇数
    valid_list.append(0)
    for i in range(1, int((n + 1) / 2)):
        valid_list.append(i * 2)
        valid_list.append(i * 2)
    if lst == valid_list:
        print(int(2 ** (((n - 1) / 2)) % 1000000007))
    else:
        print(0)
else:
    for i in range(1, int((n / 2) + 1)):
        valid_list.append((i * 2) - 1)
        valid_list.append((i * 2) - 1)
    if lst == valid_list:
        print(int(2 ** ((n / 2)) % 1000000007))
    else:
        print(0)
Problem p02973 (python)

Fixed submission:
import bisect as bs
import collections

n = int(input())
alist = [0]*n
for i in range(n):
    alist[i] = int(input())

col = collections.deque()
min_ = 10000000000

for a in alist:
    if a <= min_:
        col.appendleft(a)
    else:
        index = bs.bisect_left(col, a) - 1
        col[index] = a
    min_ = col[0]

print(len(col))

Buggy submission (verdict: Runtime Error):
import bisect as bs
import collections

n = int(input())
alist = [0]*n
for i in range(n):
    alist[i] = int(input())

col = collections.deque()
min_ = 10000000000

for a in alist:
    if a <= min_:
        col.appendleft(a)
        min_ = a
    else:
        index = bs.bisect(col, a) - 1
        ind = bs.bisect_left(col, col[index])+1
        col[ind] = a

print(len(col))
Problem p03155 (python)

Fixed submission:
n = int(input())
h = int(input())
w = int(input())
print((n-h+1)*(n-w+1))

Buggy submission (verdict: Runtime Error):
n = input()
h = input()
w = input()
print((n-h+1)*(n-w+1))
Problem p03293 (python)

Fixed submission:
a=input()
b=input()
print('Yes' if a in (b*2) else 'No')

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
printf('Yes' if a in (b*2) else 'No')
Problem p03037 (python)

Fixed submission:
n, m = [int(x) for x in raw_input().split()]
a = []
al, ar = 1, n
for _ in xrange(m):
    l, r = [int(x) for x in raw_input().split()]
    a.append((l, r))
a.sort()
for (l, r) in a:
    al = max(l, al)
    ar = min(r, ar)
ans = max(ar - al + 1, 0)
print ans

Buggy submission (verdict: Runtime Error):
a = []
al, ar = 1, n
for _ in xrange(m):
    l, r = [int(x) for x in raw_input().split()]
    a.append((l, r))
a.sort()
for (l, r) in a:
    al = max(l, al)
    ar = min(r, ar)
ans = max(ar - al + 1, 0)
print ans
Problem p03219 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File              : a.py
# Author            : recurze
# Date              : 22:46 18.01.2019
# Last Modified Date: 22:49 18.01.2019

a, b = [int(x) for x in raw_input().split()]
print a + (b>>1)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File              : a.py
# Author            : recurze
# Date              : 22:46 18.01.2019
# Last Modified Date: 22:46 18.01.2019

print int(raw_input()) + int(raw_input()) >> 1
Problem p03238 (python)

Fixed submission:
n = int(input())
if n == 1:
  print('Hello World\n')
else:
  a = int(input())
  b = int(input())
  print(a + b)

Buggy submission (verdict: Runtime Error):
import math
n, m = map(int, input().split())
res = 1
max_res = m//n
for i in range(2, math.ceil(math.sqrt(m)) + 1):
  if m % i == 0:
     if i <= max_res:
        res = max(res, i)
     x = m//i
     if x <= max_res:
        res = max(res, x)
print(res)

Buggy submission (verdict: Runtime Error):
import math
n, m = map(int, input.split())
res = 1
max_res = m//n
for i in range(2, math.ceil(math.sqrt(m)) + 1):
  if m % i == 0:
     if i <= max_res:
        res = max(res, i)
     x = m//i
     if x <= max_res:
        res = max(res, x)
print(res)

Buggy submission (verdict: Runtime Error):
n, T = map(input().split(), int)
res = 2000
for _ in range(n):
  c, t = map(input().split(), int)
  if t > T: continue
  res = min(res, c)
if res == 2000:
  print('TLE')
else:
  print(res)

Buggy submission (verdict: Runtime Error):
n, T = map(input.split(), int)
res = 2000
for _ in range(n):
  c, t = map(input.split(), int)
  if t > T: continue
  res = min(res, c)
if res == 2000:
  print('TLE')
else:
  print(res)
Problem p03239 (python)

Fixed submission:
n, T = map(int, input().split())
res = 2000
for _ in range(n):
  c, t = map(int, input().split())
  if t > T: continue
  res = min(res, c)
if res == 2000:
  print('TLE')
else:
  print(res)

Buggy submission (verdict: Runtime Error):
n, T = map(int, input.split())
res = 2000
for _ in range(n):
  c, t = map(int, input.split())
  if t > T: continue
  res = min(res, c)
if res == 2000:
  print('TLE')
else:
  print(res)
Problem p03031 (python)

Fixed submission:
n, m = map(int, input().split())
a = [[] for i in range(m)]
for i in range(m):
    t = list(map(int, input().split()))
    a[i] = t[1:]

p = list(map(int, input().split()))
ans = 0
for i in range(1<<n):
    p_ = p[:]
    for j in range(n):
        if not (i & (1<<j)):
            continue
        for k in range(m):
            if j+1 in a[k]:
                p_[k] ^= 1
    ans += (max(p_) == 0)
print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [[] for i in range(m)]
for i in range(m):
    t = list(map(int, input().split()))
    a[i] = t[1:]

p = list(map(int, input().split()))
ans = 0
for i in range(1<<n):
    p_ = p[:]
    for j in range(n):
        if not (i & (1<<j)):
            continue
        for k in range(m):
            if j+1 in a[k]:
                p_[k] ^= 1
    ans += (max(p_) == 0):
print(ans)
Problem p02923 (python)

Fixed submission:
# -*- coding:utf8 -*-

n = int(input())
l = list(map(int, input().split()))
c,p = 0,0
t = [0]
for i,n in enumerate(l):
    if p == 0:
        pass
    elif n <= p:
        c += 1
        if i == len(l) - 1:
            t.append(c)
    else:
        t.append(c)
        c = 0
    p = n
ans = max(t)
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-

n = int(input())
l = list(map(int, input().split()))
c,p = 0,0
t = []
for i,n in enumerate(l):
    if p == 0:
        pass
    elif n <= p:
        c += 1
        if i == len(l) - 1:
            t.append(c)
    else:
        t.append(c)
        c = 0
    p = n
ans = max(t)
print(ans)
Problem p02934 (python)

Fixed submission:
# -*- coding:utf8 -*-

n = int(input())
l = list(map(int, input().split()))
f = [1/i for i in l]
print(1/sum(f))

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-

n = int(input())
l = list(map(float, 1 / input().split()))
print(a/sum(l))
Problem p02947 (python)

Fixed submission:
# -*- coding:utf8 -*-
import collections

n = int(input())
s = [input() for _ in range(n)]
s = [''.join(sorted(i)) for i in s]
c = collections.Counter(s)
t = [range(i) for i in list(c.values()) if i != 1]
a = [sum(i) for i in t]
print(sum(a))

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-

n = int(input())
s = [input() for _ in range(n)]
s = [''.join(sorted(i)) for i in s]
c = collections.Counter(s)
t = [list(range(i)) for i in list(c.values()) if i != 1]
a = [sum(i) for i in t]
print(sum(t))

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-
import math

n = int(input())
s = [input() for _ in range(n)]
s = [''.join(sorted(i)) for i in s]
c = [math.factorial(s.count(i)) for i in set(s) if s.count(i) != 1]
ans = 0 if not c else sum(c)/2 
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-
import math

n = int(input())
s = [input() for _ in range(n)]
s = [''.join(sorted(i)) for i in s]
c = [math.factorial(s.count(i)) for i in set(s) if s.count(i) != 1]
print(sum(c)/2)

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-
import math

n = int(input())
s = [input() for _ in range(n)]
s = [''.join(sorted(i)) for i in s]
c = [math.factorial(s.count(i)) for i in set(s)]
print(sum(c)/2)
Problem p02953 (python)

Fixed submission:
# -*- coding:utf8 -*-

n = int(input())
h = list(map(int, input().split()))
p = h[0]
l = [p]
for i in range(1,n):
    c = h[i]
    if i == 1 and p - 1 == c:
        l[0] == c
    if p < c:
        c -= 1
    l.append(c)
    p = c
ans = 'Yes' if l == sorted(l) else 'No'
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-

n = int(input())
h = list(map(int, input().split()))
p = h[0]
l = [p]
for i in range(1,n):
    c = h[i]
    if i == 1 and p - 1 == c:
        l[0] == c
    if p < c:
        C -= 1
    l.append(c)
    p = c
ans = 'Yes' if l == sorted(l) else 'No'
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-

n = int(input())
h = list(map(int, input().split()))
ans = 'Yes'
p, pp = 0, 0
for i in h:
    if p == 0:
        p = i
    d =  p - i
    if d < -1 or (d == -1 and pp == -1):
        ans  'No'
        break
    else:
        pp = p
        p = d
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-

n = int(input())
h = list(map(int, input().split()))
ans = 'Yes'
t = h[0]
a = 0
for n in h[1:]:
    d = t - n
    if d < -1 or (d == -1 and a == -1):
        ans  'No'
        break
    else:
        t = i
        a = d
print(ans)
Problem p02957 (python)

Fixed submission:
# -*- coding:utf8 -*-

l = sorted(list(map(int,input().split())))
a, b = l[0], l[1]
ans = int(a + ((b - a) / 2)) if (b - a) % 2 == 0 else 'IMPOSSIBLE'
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-

a[0],b[1] = sorted(list(map(int,input().split())))
ans = a + ((b - a) / 2) if (b - a) % 2 == 0 else 'IMPOSSIBLE'
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-

a,b = map(int,input().split())
ans = (b - a) / 2 if (b - a) % 2 == 0 else 'IMPOSSIBLE'
if ans < 0:
    ans = ans * -1
print(ans)
Problem p02993 (python)

Fixed submission:
# -*- coding:utf8 -*-

s = input()
ans = 'Good'
for i, n in enumerate(s[:3]):
    if s[i + 1] == n:
        ans = 'Bad'
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-

s = input()
ans = 'Good'
for i in (len(s) - 1):
        if s[i] != s[i+1]:
                ans = 'Bad'
print(ans)
Problem p03001 (python)

Fixed submission:
# -*- coding:utf8 -*-

w,h,x,y = map(int, input().split())
ans = (w * h)/2
if x == w/2 and y == h/2:
    ans = str(ans) + ' 1'
else:
    ans = str(ans) + ' 0'
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding:utf8 -*-

w,h,x,y = map(int, input().split())
rec = w * h
o = '0'
all = sorted([rec * (y / h), rec * (h - y)/ h, rec * (x / w), rec * (w - x)/ w], reverse = True)
for i, n in enumerate(all):
    if n <= rec / 2:
        tr = n
        if tr == rec / 2:
            if all[i + 2] == tr:
                o = '1'
                break
        else:
            if all[i + 1] == tr:
                o = '1'
                break
ans = str(tr) + ' ' + o
print(ans)
Problem p03068 (python)

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

x = str(S[K-1])
T =""
for i in range(N):
    if S[i] != x:
        T += '*'
    else:
        T+=S[i]

print(T)

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

x = str(S[K+1])
T=S.replace(x,'*',N)
print(T)
Problem p03220 (python)

Fixed submission:
N = int(input())
T,A = map(int,input().split(" "))
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
     
m = float("inf")
arg = 0
for i in range(N):
  if H_[i] < m:
    arg = i+1
    m = H_[i]
     
print(arg)

Buggy submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input().split(" "))
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
 
m = float("inf")
arg = 0
for i in range(N):
  if H_[i] < m:
    arg = i+1
    m = H[i]
 
print(arg)

Buggy submission (verdict: Runtime Error):
N = int("2")
T,A = map(int,"12 5".split(" "))
h = "1000 2000".split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]

m = float("inf")
arg = 0
for i in range(N):
  if H_[i] < m:
    arg = i+1
    m = H[i]

print(arg)

Buggy submission (verdict: Runtime Error):
N = input()
T,A = map(int,input().split(" "))
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
print(argmin(H_)+1)

Buggy submission (verdict: Runtime Error):
N = input()
T,A = map(int,input().split(" ")
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
print(argmin(H_)+1)
Problem p03285 (python)

Fixed submission:
N = int(input())
a = N//4 +1
b = N//7 +1
     
judge = False
for i in range(a):
  for j in range(b):
    if 4*i+7*j == N:
      judge =True
      break
    if 4*i+7*j > N:
      break
  if judge:
    break
     
if judge:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
a = N//4
b = N//7

judge = False
for i in range(a):
  for j in range(b):
    if 4*i+7*k == N:
      judge =True
      break
    if 4*i+7*j > N:
      break
  if judge:
    break

if judge:
  print('Yes')
else:
  print('No')
Problem p03308 (python)

Fixed submission:
N = int(input())
A = input().split(" ")
B = [int(n) for n in A]
             
m = float("inf")
M = 0
for b in B:
  if b < m:
    m = b
              
  if b > M:
    M = b
             
print(M-m)

Buggy submission (verdict: Runtime Error):
        N = int(input())
        A = input().split(" ")
        B = [int(n) for n in A]
         
        m = float("inf")
        M = 0
        for b in B:
          if b < m:
            m = b
          
          if b > M:
            M = b
         
        print(M-m)

Buggy submission (verdict: Runtime Error):
    N = int(input())
    A = input().split(" ")
    B = [int(n) for n in A]
     
    m = inf
    M = 0
    for b in B:
      if b < m:
        m = b
      
      if b > M:
        M = b
     
    print(M-m)
Problem p03369 (python)

Fixed submission:
s = str(input())
counter = 700
if s[0] == 'o':
  counter +=100
  
if s[1] == 'o':
  counter +=100
if s[2] == 'o':
  counter +=100
  
print(counter)

Buggy submission (verdict: Runtime Error):
s = map(str,input())
counter = 700
if s[0] == 'o':
  counter +=100
if s[1] == 'o':
  counter +=100
if s[2] == 'o':
  counter +=100

print('counter')
Problem p03370 (python)

Fixed submission:
minimam = float("inf")
sum_ = 0
     
N,X = map(int,input().split())
     
for i in range(N):
  m = int(input())
  sum_ += m
  if m < minimam:
    minimam = m
        
n = N
X_1 = X-sum_
n += X_1 // minimam
     
print(n)

Buggy submission (verdict: Runtime Error):
m=[]
minimam = float("inf")
sum_ = 0

N,X = map(int(),input().split())
 
for i in range(N):
  m = int(input())
  sum_ += m
  if m < minimam:
    minimam = m
    
n = N
X_1 = X-sum_
n += X_1 // minimam
 
print(n)

Buggy submission (verdict: Runtime Error):
N,X = map(int(),input().split())
m=[]
minimam = float("inf")
sum = 0

for i in range(N):
  m = int(input())
  sum += m
  if m < minimam:
    minimam = m
    
n = N
X_1 = X-sum
n += X_1 // minimam

print(n)
Problem p03433 (python)

Fixed submission:
N = int(input())
A = int(input())
         
if N%500 <=A:
  print('Yes')
         
else:
  print('No')

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

if N%500 <=A:
  print('YES')

else:
  print('NO')
Problem p03469 (python)

Fixed submission:
s = str(input())
t = s.replace("2017","2018")
print(t)

Buggy submission (verdict: Runtime Error):
s = str(input())
t = s.replace("2017","2018")
pirnt(t)

Buggy submission (verdict: Runtime Error):
s = str(input())
s[:5] = '2018'
print(s)
Problem p03471 (python)

Fixed submission:
N,Y = map(int,input().split(" "))
K = Y//1000 -N
     
l = int(-K/4)-1
r = -(2*K)/9+1

if l<=r:
    i=l
    while i <=r:
        a = K+4*i
        b = -2*K-9*i
        c = N-a-b

        if a>=0 and b>=0 and c >=0:
            print(a," ",b," ",c)
            break

        i+=1
    else:
        print(-1," ",-1," ",-1)

else:
    print(-1," ",-1," ",-1)

Buggy submission (verdict: Runtime Error):
N,Y = map(int,input().split(" "))
K = Y//1000 -N
     
l = int(-K/4)
if l <= -2*K/9:
    a = K+4*l
    b = -2*K-9*l
    c = N-a-b
    if c >=0:

        print(a," ",b," ",c)
     else:
        print(-1," ",-1," ",-1)
else:
    print(-1," ",-1," ",-1)
Problem p03486 (python)

Fixed submission:
s = str(input())
t = str(input())
 
s_ = list(s)
t_ = list(t)
 
s_.sort()
t_.sort(reverse = True)
 
s_sorted = ""
for S in s_:
  s_sorted += S
 
t_sorted =""
for T in t_:
  t_sorted += T
 
if s_sorted < t_sorted:
  print('Yes')
  
else:
  print('No')

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

s_ = list(s)
t_ = list(t)

s_.sort()
t_.sort(reverce = True)

s_sorted = ""
for S in s_:
  s_sorted += S

t_sorted =""
for T in t_:
  t_stored += T

if s_sorted < t_sorted:
  print('Yes')
else:
  print('No')
Problem p03503 (python)

Fixed submission:
N=int(input())
F=[]
for i in range(N):
    tem = list(map(int,input().split()))
    F.append(tem)
P=[]
for i in range(N):
    tem = list(map(int,input().split()))
    P.append(tem)


max_benef =-float("inf")

for d in range(1,2**10):
    op = ["-"] * 10  # あらかじめ ["-", "-", "-"] というリストを作っておく
    for j in range(10):
        if ((d >> j) & 1):
            op[10 - 1 - j] = "+"  # フラグが立っていた箇所を "+" で上書き
    
    m =0
    count=[0 for s in range(N)]
    for t in range(10):
        if op[t]=="+":
            for s in range(N):
                if F[s][t]==1:
                    count[s]+=1
    for s in range(N):
        m += P[s][count[s]]
    max_benef = max(m,max_benef)
    
print(max_benef)

Buggy submission (verdict: Runtime Error):
N=int(input())
F=[]
for i in range(N):
    tem = list(map(int,input().split()))
    F.append(tem)
P=[]
for i in range(N):
    tem = list(map(int,input().split()))
    P.append(tem)


max_benef =-float("inf")

for d in range(1,2**10):
    op = ["-"] * 10  # あらかじめ ["-", "-", "-"] というリストを作っておく
    for j in range(10):
        if ((d >> j) & 1):
            op[10 - 1 - j] = "+"  # フラグが立っていた箇所を "+" で上書き
    
    m =0
    count=[0 for t in range(10)]
    for t in range(10):
        if op[t]=="+":
            for s in range(10):
                if F[s][t]==1:
                    count[s]+=1
        for s in range(10):
            m += P[s][count[s]]
        ans = max(m,ans)
    
    print(ans)
Problem p03624 (python)

Fixed submission:
s = str(input())
     
alphabet = "abcdefghijklmnopqrstuvwxyz"
     
ans ='None' 
for i in range(len(alphabet)):
        if not alphabet[i] in s:
                ans = alphabet[i]
                break
print(ans)

Buggy submission (verdict: Runtime Error):
s = str(input())
     
alphabet = "abcdefghijklmnopqrstuvwxyz"
     
for i in range(len(alphabet)):
        if not alphabet[i] in s:
                ans = alphabet[i]
                break
print(ans)

Buggy submission (verdict: Runtime Error):
s = str(input())
 
alphabet = "abcdefghijklmnopqrstuvwxyz"

for i in range(len(alphabet)):
  if alphabet[i] in s:
  else:
    ans = alphabet[i]
    break
print(ans)

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

alphabet = "abcdefghijklmnopqrstuvwxyz"
for i in range(alphabet):
  if alphabet[i] not in s:
    print(i)
    break
Problem p03658 (python)

Fixed submission:
N, K = map(int,input().split(" "))
L = list(map(int,input().split(" ")))
     
L.sort(reverse = True)
length_of_snake = 0
for i in range(K):
        length_of_snake += L[i]
     
print(length_of_snake)

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

L.sort(inverse = True)
length_of_snake = 0
for i in range(K):
  length_of_snake += L[i]

print(length_of_snake)
Problem p03693 (python)

Fixed submission:
a,b, c = map(int, input().split())
if (10*b+c)%4 ==0:
  print('YES')
     
else:
  print('NO')

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

if 10*b+c % 4 ==0:
  print('YES')
  
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input.split())
if 10*b+c%4==0:
  return 'YES'

else:
  return 'NO'
Problem p03944 (python)

Fixed submission:
W,H,N = map(int,input().split(" "))
Lx = [1 for i in range(W)]
Ly = [1 for i in range(H)]
 
for i in range(N):
  xi,yi,ai = map(int,input().split(" "))
  if ai ==1:
    for j in range(xi):
      Lx[j] = 0
         
  if ai ==2:
    for j in range(xi,W):
      Lx[j] = 0
    
  if ai ==3:
    for j in range(yi):
      Ly[j] = 0
    
  if ai ==4:
    for j in range(yi,H):
      Ly[j] = 0
x = sum(Lx)
y = sum(Ly)
 
print(x*y)

Buggy submission (verdict: Runtime Error):
W,H,N = map(int,input().split(" "))
Lx = [1 for i in range(N)]
Ly = [1 for i in range(N)]

for i in range(N):
  xi,yi,ai = map(int,input().split(" "))
  if ai ==1:
    for j in range(xi):
      Lx[j] = 0
         
  if ai ==2:
    for j in range(xi,W):
      Lx[j] = 0
    
  if ai ==3:
    for j in range(yi):
      Ly[j] = 0
    
  if ai ==4:
    for j in range(yi,H):
      Ly[j] = 0
x = sum(Lx)
y = sum(Ly)

print(x*y)
Problem p03632 (python)

Fixed submission:
a,b,c,d=map(int, input().split())
answer=0

if a<c:
    if b>c:
        if b>d:
            answer=d-c
        else:
            answer=b-c
else:
    if d>a:
        if d>b:
            answer=b-a
        else:
            answer=d-a
print(answer)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int, input().split())
answer=0

if a<c:
    if b>c:
        if b>d:
            answer=d-c
        else:
            answer=b-c
else:
    if d>a:
        if d>b:
            answer=b-aa
        else:
            answer=d-a
print(answer)
Problem p02927 (python)

Fixed submission:
input_data = input().split(" ")
M = int(input_data[0])
D = input_data[1]

cnt = 0
for i in range(1,M + 1):
  for j in range(22, int(D) + 1):
    if i == int(str(j)[0]) * int(str(j)[1]) and int(str(j)[1]) != 0  and int(str(j)[1]) != 1:
      cnt += 1
    else:
      pass

print(cnt)

Buggy submission (verdict: Runtime Error):
input_data = input().split(" ")
M = int(input_data[0])
D = input_data[1]
d1 = int(D[1])
d10 = int(D[0])
cnt = 0
for i in range(1,M + 1):
  for j in range(22, int(D) + 1):
    if i == int(str(j)[0]) * int(str(j)[1]) and int(str(j)[1]) != 0  and int(str(j)[1]) != 1:
      cnt += 1
    else:
      pass

print(cnt)