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

Fixed submission:
import math
def prime_divisor(n):
    ls = []
    i = 2
    while i <= math.floor(n**0.5):
        if n%i == 0:
            ls.append(i)
            ls.append(n//i)
            i += 1
        else:
            i += 1
    if n > 1:
        ls.append(n)
    return ls
N = int(input())
ls1 = prime_divisor(N)
ls2 = [x-1 for x in list(set(ls1)) if x >= 2]
ls2.sort()
ls2.reverse()
ans = 0
for i in range(len(ls2)):
    if N // ls2[i] == N % ls2[i]:
        ans += ls2[i]
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def prime_divisor(n):
    ls = []
    i = 2
    while i <= math.floor(n**0.5):
        if n%i == 0:
            ls.append(i)
            ls.append(n//i)
            i += 1
        else:
            i += 1
    if n > 1:
        ls.append(n)
    return ls
N = int(input())
ls1 = prime_divisor(N)
ls2 = [x-1 for x in list(set(ls1)) if x >= 2]
ls2.sort()
ls2.reverse()
ans = 0
for i in range(len(ls1)):
    if N // ls2[i] == N % ls2[i]:
        ans += ls2[i]
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def prime_divisor(n):
    ls = []
    i = 2
    while i <= math.floor(n**0.5):
        if n%i == 0:
            ls.append(i)
            ls.append(n//i)
            i += 1
        else:
            i += 1
    if n > 1:
        ls.append(n)
    return ls
N = int(input())
ls1 = prime_divisor(N)
ls2 = [x-1 for x in list(set(ls1)) if x >= 2]
ls2.sort()
ls2.reverse()
print(ls2)
ans = 0
for i in range(len(ls1)):
    if N // ls2[i] == N % ls2[i]:
        ans += ls2[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N =int(input())
ans = 0
for j in range(N,2):
  for i in range(N//j,N//(j-1)):
    if (N//i) == N%i:
        ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
for i in range(1,N//4):
    if (N//i) == N%i:
        ans += i
for i in range(N//4,N//3):
    if (N//i) == N%i:
        ans += i
for i in range(N//3,N//2):
    if (N//i) == N%i:
        ans += i
for i in range(N//2,N):
    if (N//i) == N%i:
        ans += i
print(ans)
Problem p03067 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input(),split())
if a>c>b:
print("Yes")
elif b>c>a:
print("Yes")
else:
print("No")
Problem p03071 (python)

Fixed submission:
def Y(flag):
    if flag:
        print('YES')
    else:
        print('NO')
 
def y(flag):
    if flag:
        print('Yes')
    else:
        print('No')
 
a,b = map(int,input().split())
l = [a,b,a-1,b-1]
l = sorted(l)
print(l[-1] + l[-2])

Buggy submission (verdict: Runtime Error):
#整数の入力
a,b = int(input()split())
#コインの枚数をXとする
X = int()
X = 0
if a>=b:
X = X + a
a = a - 1
else:
  X = X + b
  b = b - 1
  
print(X)

Buggy submission (verdict: Runtime Error):
input(int(A,B))
int(X)
X = 0
if(A>=B)
X = X + A
A = A - 1
else(B>A)
X = X + B
B = B - 1
print(X)
Problem p03079 (python)

Fixed submission:
A,B,C = map(int,input().split())
if A == B == C:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
P = S.replace("B","")
if N%2 == 1:
  k = N//2+1
else:
  k = N//2
if len(P)>k:
  print("Yes")
else:
  print("No")
Problem p03085 (python)

Fixed submission:
b = input()
if b=="A":
  print("T")
elif b=="C":
  print("G")
elif b=="G":
  print("C")
else:
  print("A")

Buggy submission (verdict: Runtime Error):
b = input()
if b="A":
  print("T")
elif b="C":
  print("G")
elif b="G":
  print("C")
else:
  print("A")
Problem p03086 (python)

Fixed submission:
S = input()
mode = 0
now = 0
k = []
for i in range(len(S)):
    if str(S[i]) == "A" or str(S[i]) == "T" or str(S[i]) == "G" or str(S[i]) == "C":
        if mode == 0:
            mode = 1
            now += 1
        else:
            now += 1
    else:
        k.append(now)
        now = 0
        mode = 0
k.append(now)
if len(k) == 0:
    print(0)
else:
    print(max(k))

Buggy submission (verdict: Runtime Error):
S = input()
mode = 0
now = 0
k = []
for i in range(len(S)):
    if str(S[i]) == "A" or str(S[i]) == "T" or str(S[i]) == "G" or str(S[i]) == "C":
        if mode == 0:
            mode = 1
            now += 1
        else:
            now += 1
    else:
        k.append(now)
        now = 0
        mode = 0
print(max(k))

Buggy submission (verdict: Runtime Error):
#KyoproRの競技プログラミング過去問配信
S = input()
k = []
b = ["A","C","G","T"]
a = 0
for i in range(len(S)):
    #len(S)の間roop
    #S[i]が"A" "C" "G" "T"のいずれかであるかを判定
    if S[i] in b:
        if i == len(S)-1:
            k.append(1)
            break
        else:
            for j in range(len(S)-1):
                if S[i+j] in b:
                    a += 1
                else:
                    k.append(a)
                    a = 0
                    break
if len(k) == 0:
    print(0)
else:
    print(max(k))

Buggy submission (verdict: Runtime Error):
S = input()
k = []
b = ["A","C","G","T"]
a = 0
for i in range(len(S)):
    #len(S)の間roop
    #S[i]が"A" "C" "G" "T"のいずれかであるかを判定
    if S[i] in b:
        if i == len(S)-1:
            k.append(1)
            break
        else:
            for j in range(len(S)-1):
                if S[i+j] in b:
                    a += 1
                else:
                    k.append(a)
                    a = 0
                    break
print(max(k))
Problem p03105 (python)

Fixed submission:
A,B,C = map(int,input().split())
if (A * C) <=B:
  print(C)
else:
  print(B // A)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
if A*C =<B:
  print("C")
else:
  print(B % A)
Problem p03106 (python)

Fixed submission:
A,B,K = map(int,input().split())
L = 0
ans = 0
for i in reversed(range(1,2000)):
  if A%i == 0:
    if B%i == 0:
      L += 1
    else:
      L += 0
  else:
    L += 0
  if L == K:
    ans = i
    break
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
L = 0
ans = 0
for i in reversed(1,100):
  if A%i == 0:
    if B%i == 0:
      L += 1
    else:
      L += 0
  else:
    L += 0
  if L == K:
    ans = i
    break
print(ans)
Problem p03126 (python)

Fixed submission:
N,M = map(int,input().split())
A = [0]*M
ans = 0
for i in range(N):
  k = list(map(int,input().split()))
  for j in range(1,len(k)):
    A[k[j]-1] += 1
for i in range(len(A)):
  if A[i] == N:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = []
S = []
for i in range(N):
  A.append(list(map(int,input().split())))
for i in range(1,K):
  S.append(A[i])
s_count = [x for x in S if S.count(x) == N]
  print(len(S_count))
Problem p03129 (python)

Fixed submission:
n,k = map(int,input().split())
if n>=2*k-1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
if N>=2*K-1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
if N>=2K-1:
  print("YES")
else:
  print("NO")
Problem p03210 (python)

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

Buggy submission (verdict: Runtime Error):
X = int(input())
if X = 3:
  print("YES")
elif X = 5:
  print("YES")
elif X = 7:
  print("YES")
else:
  print("NO")
Problem p03219 (python)

Fixed submission:
X,Y = map(int,input().split())
K =int((X+(0.5*Y)))
print(K)

Buggy submission (verdict: Runtime Error):
l=map(int,input().split())
x=l[0]
y=l[1]
print(x+y/2)
Problem p03254 (python)

Fixed submission:
N,x = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
ans = 0
for i in range(N):
  if A[i] <= x:
    if i == N-1:
      if x == A[i]:
        ans += 1
    else:
      x -= A[i]
      ans += 1
  else:
    break
print(ans)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
A = list(map(int,input().split()))
ans = 0
for i in range(N):
  if A[i] > x :
    print(ans)
    break
  else:
    x -= A[i]
    if i == N-1:
      print(N-1)
      break
Problem p03261 (python)

Fixed submission:
N = int(input())
word = []
S = input()
word.append(S)
flag = 0
for i in range(N-1):
  S = input()
  if S[0] == word[i][-1]:
    if S not in word:
      word.append(S)
    else:
      print("No")
      flag +=1
      break
  else:
    print("No")
    flag += 1
    break
if flag == 0:
  print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = []
w = []
for i in range(N):
  ls.append(str(input())
for j in range(1,N):
  if ls[j-1][(len(ls[j])-1):] and ls[j][(len(ls[j])-1):]
    if ls[j-1] in w:
      print("No")
    else:
      w.append(ls[j-1])
  else:
    print("No")
    break
Problem p03264 (python)

Fixed submission:
k =int(input())
odd_num = (k-1)//2 +1
even_num = k//2
print((odd_num)*(even_num))

Buggy submission (verdict: Runtime Error):
K =int(input())
odd_num = (k-1)//2 +1
even_num = k//2
print((odd_num)*(even_num))
Problem p03281 (python)

Fixed submission:
N = int(input())
now = 0
ans = 0
for i in range(1,N+1):
    if i%2 == 0:
        continue
    else:
        for j in range(1,i+1):
            if i%j == 0:
                now += 1
        if now == 8:
            ans += 1
        now = 0
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
k = []
ans = 0
ans_2 = 0
for i in range(1,200):
  k.append(i)
for i in range(N):
  for j in range(N):
    if i%k[i] == 0:
      if ans == 8:
        ans_2 += 1
        break
      else:
        ans += 1
print(ans_2)
Problem p03288 (python)

Fixed submission:
R = int(input())
if R<1200:
  print("ABC")
elif R<2800:
  print("ARC")
else:
  print("AGC")

Buggy submission (verdict: Runtime Error):
S = input()
flag = 0
flag_of_flag = 0
now = 0
komoji = 0
k = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
if S[0] == "A":
  flag += 1
for i in range(2,len(S)-1):
  if S[i] == "C":
    now += 1
  elif S[i] in k:
    komoji += 1
if now == 1:
  flag += 1
if S[1] in k and S[len(S)-2] in k and S[len(S)-1] in k:
  komoji += 3
if flag == 2:
  if komoji == len(S)-2:
    print("AC")
  else:
    print("WA")
else:
  print("WA")
Problem p03316 (python)

Fixed submission:
n = input()
N = int(n)
n = list(n)
ans = 0
for i in range(len(n)):
  n[i] = int(n[i])
  ans += int(n[i])
if N % ans == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = input()
N = int(n)
n = list(n)
ans = 0
for i in range(len(n)):
  n[i] = int(n[i])
ans += int(n[i])
if N % ans == 0:
  print("Yes")
else:
  print("No")
Problem p03324 (python)

Fixed submission:
D,N = map(int,input().split())
K = (100**D)*N
if N%100 == 0:
  K = (100**D)*(N+1)
print(K)

Buggy submission (verdict: Runtime Error):
D,N = map(int,input().split())
K = (100**D)*N
if K%100 == 0:
　K = (100**D)*(N+1)
print(K)
Problem p03328 (python)

Fixed submission:
a,b = map(int,input().split())
x = 1
y = 3
for i in range(10**5):
    if x-a == y-b:
        print(x-a)
        break
    else:
        x += i+2
        y += i+3

Buggy submission (verdict: Runtime Error):
N = int(input())
now = 0
ans = 0
for i in range(1,N+1):
    if i%2 == 0:
        continue
    else:
        for j in range(1,i+1):
            if i%j == 0:
                now += 1
        if now == 8:
            ans += 1
        now = 0
print(ans)
Problem p03351 (python)

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

Buggy submission (verdict: Runtime Error):
ls = [1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000,1020]
X = int(input())
for i in range(len(ls)):
  if X<ls[i]:
    print(ls[i-1])
    break

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
k = 0
if d>=abs(a-c):
  print("Yes")
  k += 1
if d>=abs(a-b):
  if d>=abd(b-c):
    if k == 1:
      break
    else:
      print("Yes")
      k += 1
if k == 0:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = 0
if abs(a-c)=<d:
  print("Yes")
  l += 1
if abs(a-b)=<d:
  if abs(b-c)=<d:
    if l == 0:
      print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
if abs(a-b)=<d:
  if abs(b-c)=<d:
    print("Yes")
  else:
    print("No")
else:
  print("No")
Problem p03360 (python)

Fixed submission:
A,B,C = map(int,input().split())
K = int(input())
L = max(A,B,C)
if L == A:
  print((A*(2**K))+B+C)
elif L == B:
  print(A+(B*(2**K))+C)
else:
  print(A+B+(C*(2**K)))

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
K = int(input())
L = max(A,B,C)
if L ==A:
print((A*(2**K))+B+C
elif L ==B:
print(A+(B*(2**K))+C)
else:
print(A+B+(C*(2**K)))
Problem p03424 (python)

Fixed submission:
N = int(input())
S = input().split()
K = set(S)
p = list(K)
if len(p) == 3:
  print("Three")
elif len(p) == 4:
  print("Four")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input().split()
K = set(S)
p = list(k)
if len(p) == 3:
  print("Three")
elif len(p) == 4:
  print("Four")
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
if (a*b)%2 == 1:
  print("Odd")
else:
  print("Even")
Problem p03469 (python)

Fixed submission:
S=str(input())
 
k=S.replace("2017","2018")
 
print(k)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 1
d = []
for i in range(N):
  d.append(int(input()))
sorted(d,reverse=True)
print(set(d))
Problem p03470 (python)

Fixed submission:
N = int(input())
ans = 1
d = []
for i in range(N):
  d.append(int(input()))
sorted(d,reverse=True)
k = set(d)
K = list(k)
print(len(K))

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 1
d = []
for i in range(N):
  d.append(int(input()))
sorted(d,reverse=True)
for i in range(len(d)-1):
  if d[i] == d[i+1]:
    d.remove(d[i+1])
print(len(d))
Problem p03478 (python)

Fixed submission:
N,A,B = map(int,input().split())
ans = 0
for i in range(1,N+1):
  K = str(i)
  if len(K) == 1:
    if A<=int(K[0])<=B:
      ans += i
  elif len(K) == 2:
    if A<=int(K[0])+int(K[1])<=B:
      ans += i
  elif len(K) == 3:
    if A<=int(K[0])+int(K[1])+int(K[2])<=B:
      ans += i
  elif len(K) == 4:
    if A<=int(K[0])+int(K[1])+int(K[2])+int(K[3])<=B:
      ans += i
  elif len(K) == 5:
    if A<=int(K[0])+int(K[1])+int(K[2])+int(K[3])+int(K[4])<=B:
      ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
ans = 0
for i in range(N):
  s = str(i)
  if 1<=i<=9:
    if A<=i<=B:
      ans += i
  elif 10<=i<=99:
    if A<=((int(s[0])+int(s[1])))<=B:
      ans += i
  elif 100<=i<=999:
    if A<=((int(s[0])+int(s[1])+int(s[2])))<=B:
      ans += i
  elif 1000<=i<=9999:
    if A<=((int(s[0])+int(s[1])+int(s[2])+int(s[3])))<=B:
      ans += i
  else:
    if A<=((int(s[0])+int(s[1])+int(s[2])+int(s[3])+int(s[4])))<=B:
      ans += i
print(ans)
Problem p03544 (python)

Fixed submission:
L = [2,1]
for i in range(100):
  L.append(L[i+1]+L[i])
n = int(input())
print(L[n])

Buggy submission (verdict: Runtime Error):
N = int(input())
k = [2,1]
if N == 1:
  print(1)
else:
  for i in range(N-1):
    S = k[i]+k[i+1]
    k.append(S)
print(S)

Buggy submission (verdict: Runtime Error):
N = int(input())
L_2 = 2
L_1 = 1
for i in range(N-1):
  K = L_1+L_2
  L_2 = L_1
  L_1 = K
print(K)

Buggy submission (verdict: Runtime Error):
N = int(input())
L_2 = 2
L_1 = 1
p = 0
for i in range(N-1):
  K = L_1+L_2
  L_2 = L_1
  L_1 = K
print(K)

Buggy submission (verdict: Runtime Error):
N = int(input())
L_2 = 2
L_1 = 1
p = 0
for i in range(2,N+1):
  K = L_1+L_2
  L_2 = L_1
  L_1 = K
print(K)

Buggy submission (verdict: Runtime Error):
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
K = []
S = 0
ans = 0
J = []
for i in range(N):
  K.append(list(map(int,input().split())))
for i in range(N):
  for j in range(M):
    S += K[i][j]*B[j]
  S = S + C
  J.append(S)
for i in range(N):
  if J[i] >0:
    ans += 1
  else:
    ans += 0
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
L0 = 2
L1 = 1
for i in range(N-1):
  M = L0+L1
  L0 = L1
  L1 = M
print(M)

Buggy submission (verdict: Runtime Error):
N = int(input())
L0 = 2
L1 = 1
for i in range(N-1):
  M = L0+L1
  L0 = L1
  L1 = M
print(M)
Problem p03555 (python)

Fixed submission:
C = str(input())
D = str(input())
if C[0] == D[2] and C[1] == D[1] and C[2] == D[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
R = int(input())
G = int(input())
print(2*G-R)

Buggy submission (verdict: Runtime Error):
R = int(input())
G = int(input())
print(2*G-R)
Problem p03557 (python)

Fixed submission:
import bisect
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
A.sort()
C.sort()
for i in B:
    x = bisect.bisect_left(A,i)
    y = N-bisect.bisect_right(C,i)
    ans += x*y
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort()
B.sort()
C.sort()
sum = 0
for i in range(0,N):
  a = A[i]
  for j in range(1,N):
    b = B[j]
    c_min = b-a+1
    c_max = a+b-1
    l = bisect.bisect_left(C,c_min,lo = j+1)
    if l! = N:
      r = bisect.bisect_right(C,c_max,lo = j+1)
      if r:
        r = r-1
        if r >= l:
          sum += r-l+1
print(sum)
Problem p03573 (python)

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

if A-B == A-C:
  print(A)
elif B-A == B-C:
  print(B)
else:
  print(C)

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
ls = []
side = [[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]]
for i in range(h):
  ls.append(list(input()))
for i in range(h):
  ans2 = ""
  for j in range(w):
    ans = 0
    if ls[i][j] == "#":
      ans2 += "#"
    else:
      for k in range(8):
        if i+side[k][0] < 0 or j+side[k][1] < 0 or h <=i+side[k][0] or w <= j+side[k][1]:
          continue
        else:
          ans += (1 if ls[i+side[k][0]][j+side[k][1]] == "#" else 0)
      ans2 += str(ans)
  print(ans2)

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
ls = []
side = [[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]]
for i in range(h):
  ls.append(list(input()))
for i in range(h):
  ans2 = ""
  for j in range(w):
    ans = 0
    if ls[i][j] == "#":
      ans2 += "#"
    else:
      for k in range(8):
        if i+side[k][0] < 0 or j+side[k][1] < 0 or h <=i+side[k][0] or w <= j+side[k][1]:
          continue
        else:
          ans += (1 if ls[i+side[k][0]][j+side[k][1]] == "#" else 0)
      ans2 += str(ans)
  print(ans2)

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
ls = []
side = [[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]]
for i in range(h):
  ls.append(list(input()))
for i in range(h):
  ans2 = ""
  for j in range(w):
    ans = 0
    if ls[i][j] == "#":
      ans2 += "#"
    else:
      for k in range(8):
        if i+side[k][0] < 0 or j+side[k][1] < 0 or h <=i+side[k][0] or w <= j+side[k][1]:
          continue
        else:
          ans += (1 if ls[i+side[k][0]][j+side[k][1]] == "#" else 0)
      ans2 += str(ans)
  print(ans2)
Problem p03605 (python)

Fixed submission:
N = str(input())
if N[0] =="9":
  print("Yes")
elif N[1] == "9":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
from itertools import permutations
N,M,R = map(int,input().split())
r = list(map(int,input().split()))
for i in range(R):
  r[i] -= 1
g = [[10 ** 8] * N for i in range(N)]
for i in range(M):
  A,B,C = map(int,input().split())
  A -= 1 
  B -= 1
  g[A][B] = C
  g[B][A] = C
def warchall_floyd(n):
  for i in range(n):
    #経由する頂点
    for j in range(n):
      #始点
      for k in range(n):
        #終点
        g[j][k] = min(g[j][k],g[j][i]+g[i][k])
        
warchall_floyd(N)
ans = float('inf')
for i in permutations(r):
  now = 0
  for j in range(R-1):
    now += g[i[j]][i[j+1]]
  if now < ans:
    ans = now
print(ans)
Problem p03624 (python)

Fixed submission:
S = input()
ls= ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
ls2=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for i in range(len(S)):
  for j in range(len(ls)):
    if S[i] == ls[j]:
      if ls[j] in ls2:
        ls2.remove(ls[j])
      break
if len(ls2) == 0:
  print("None")
else:
  print(ls2[0])

Buggy submission (verdict: Runtime Error):
S = input()
k = []
ans = []
alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for i in range(len(S)):
  k.append(S[i])
k = sorted(k)
for i in range(26):
  if k[i] not in alphabet:
    ans.append(k[i])
print(ans[0])
Problem p03657 (python)

Fixed submission:
A,B = map(int,input().split())
if A%3 == 0:
  print("Possible")
elif B%3 == 0:
  print("Possible")
elif (A+B)%3 == 0:
  print("Possible")
else:
  print("Impossible")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
ruiseki = [0]*(N+1)
total = 0
now = 10**9+7
sa = 0
now_2 = 0
for i in range(N):
  total += A[i]
  ruiseki[i+1] = total
for i in range(1,len(ruiseki)-1):
  snuke = ruiseki[i]-ruiseki[0]
  arai = ruiseki[N]-ruiseki[i]
  now_2 = abs(snuke-arai)
  now = min(now,now_2)
print(now)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
sorted(l)
for i in range(K):
  ans += l[n-i-1]
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
sorted(l)
for i in range(K):
  ans += l[n-i+1]
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
l.sort()
for i in range(K):
  ans += l[i]
print(ans)
Problem p03658 (python)

Fixed submission:
N,K = map(int,input().split())
L = list(map(int,input().split()))
L.sort()
ans = 0
for i in range(K):
  ans += L[-(i+1)]
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
l.sorted()
for i in range(K):
  ans += l[i]
print(ans)
Problem p03698 (python)

Fixed submission:
S = input()
K =[]
for i in range(len(S)):
  if S[i] in K:
    print("no")
    break
  else:
    K.append(S[i])
  if i == len(S)-1:
    print("yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
Ma = max(A)
Mi = min(A)
print(Ma-Mi)
Problem p03711 (python)

Fixed submission:
i = list(map(int, input().split()))
 
A_list = [1, 3, 5, 7, 8, 10, 12]
B_list = [4, 6, 9, 11]
C_list = [2]
 
if i[0] in A_list and i[1] in A_list:
    print("Yes")
elif i[0] in B_list and i[1] in B_list:
    print("Yes")
elif i[0] in C_list and i[1] in C_list:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
i = list(map(int,input().split()))
A_list[1,3,5,7,8,10,12]
B_list[4,6,9,11]
C_list[2]
if i[0] in A_list and i[1] in A_list:
  print("Yes")
if i[0] in B_list and i[1] in B_list:
  print("Yes")
if i[0] in C_list and i[1] in C_list:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split()))
A_list[1,3,5,7,8,10,12]
B_list[4,6,9,11]
C_list[2]
if i[0] in A_list and i[1] in A_list:
  print("Yes")
if i[0] in B_list and i[1] in B_list:
  print("Yes")
if i[0] in C_list and i[1] in C_list:
  print("Yes")
else:
  print("No")
Problem p03719 (python)

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

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input(),split())
if C>=A and C<=B:
  print("Yes")
else:
  print("No")