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

Fixed submission:
x = int(input())
if x >= 30:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
#####segfunc######
def segfunc(x,y):
    return x | y

def init(init_val):
    #set_val
    for i in range(n):
        seg[i+num-1]=set([init_val[i]])  
    #built
    for i in range(num-2,-1,-1) :
        seg[i]=segfunc(seg[2*i+1],seg[2*i+2]) 
    
def update(k,x):
    k += num-1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = segfunc(seg[k*2+1],seg[k*2+2])
    
def query(p,q):
    if q<=p:
        return ide_ele
    p += num-1
    q += num-2
    res=ide_ele
    while q-p>1:
        if p&1 == 0:
            res = segfunc(res,seg[p])
        if q&1 == 1:
            res = segfunc(res,seg[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = segfunc(res,seg[p])
    else:
        res = segfunc(segfunc(res,seg[p]),seg[q])
    return res

#####単位元######
ide_ele = set()

#num:n以上の最小の2のべき乗

n, Q = map(int, input().split())

num =2**(n-1).bit_length()
seg=[ide_ele]*2*num

c = list(map(int,input().split()))
init(c)
for _ in range(Q):
    l, r = map(int, input().split())
    ans = query(l-1,r)
    print(len(ans))
Problem p02552 (python)

Fixed submission:
x = int(input())
if x == 1:
    print(0)
elif x == 0:
    print(1)

Buggy submission (verdict: Runtime Error):
A = input()
B = A.split()
a = int(B[0])
b = int(B[1])
c = int(B[2])
d = int(B[3])

if a <= 0 and b <= 0 and c <= 0 and d <= 0:
    print(a*c)
elif a > 0 and b > 0 and c > 0 and d > 0:
    print(b*d)
elif a > 0 and b > 0 and c<=0 and d<=0:
    print(a*d)
elif a<=0 and b<=0 and c>0 and d>0:
    print(b*c)
elif a<=0 and b<=0 and c<=0 and d>0:
    print(a*c)
elif a>0 and b>0 and c<=0 and d>0:
    print(b*d)
elif a <= 0 and b > 0:
    if c <= 0 and d > 0:
        if -c <= d and -a <= b:
            print(d*b)
        elif -c <= d and -a > b:
            if a*c > b*d:
                print(a*c)
            elif a*c <= b*d:
                print(b*d)
        elif -c > d and -a <= b:
            if a*c > b*d:
                print(a*c)
            elif a*c <= b*d:
                print(b*d)
        elif -c > d and -a > b:
            print(a*c)
    elif c> 0 and d <= 0:
        print()
    elif c<=0 and d<=0:
        print(a*c)
Problem p02577 (python)

Fixed submission:
#B問題

#ABSの定石使うとなぜかRE

#今回はPython解説サイト参照

#①入力を文字列で受け取る→②一文字ずつ整数に変換して、forループで回しながら足し算する

N = input()
cur = 0

for i in N:
    cur += int(i)

if cur % 9 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#B問題
n = int(input())

# ある整数に対し、各桁の和を与える

sum = 0
while n > 0:
    sum += n % 10
    n = int(n / 10)
    
ans = sum % 9
    
if ans == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#B問題
n = int(input())
# ある整数に対し、各桁の和を与える

def findSumOfDigits(n):
    sum = 0
    while n > 0:
        sum += n % 10
        n = int(n / 10)
    return sum

ans = findSumOfDigits(n) % 9 

if ans == 0:
    print("Yes")
else:
    print("No")
Problem p02629 (python)

Fixed submission:
n = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"  # x番目がほしいときにchars[x-1]としたくないので、chars[0]は使わないことにします

n_rem = n  # 入力を直接操作すると、もし後々必要になったときに面倒なので
res = ""

while True:
    x = n_rem % 26
    # 余りが0、つまりzの場合は、26にします
    if x == 0:
        x = 26
    res += chars[x]

    # xを引いて、26で割ります
    n_rem -= x

    # 0なら終了します
    if n_rem == 0:
        break

    n_rem //= 26

# 0桁目が先頭で、最後の桁が末尾になっているので、反転させます
print(res[::-1])

Buggy submission (verdict: Runtime Error):
#C問題解説

n = int(input())  
chars = "Xabcdefghijklmnopqrstuvwxyz" # x番目がほしいときにchars[x-1]としたくないので、chars[0]は使わないことにします
n_rem = n  # 入力を直接操作すると、もし後々必要になったときに面倒なので
res = "" #最終的な答え格納用

while True:
    x = n_rem % 26
    # 余りが0、つまりzの場合は、26にします
    if x == 0:
        x = 26
    #1番目(a)~26番目(z)から対応する文字を取ってく
    res += chars[x] 
    
    #xを引いて26で割る
    n_rem -= x
    if n_rem == 0:
        break
    
    n_rem // = 26

# 0桁目が先頭で、最後の桁が末尾になっているので、反転させます
print(res[::-1])
Problem p02552 (python)

Fixed submission:
num = int(input())
if num == 0:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
x = a
y = c
max = x * y
if b < 0:
  print(max)
else:
  for x in range(a,b + 1):
    for y in range(c,d + 1):
      if x * y > max:
        max = x * y
  print(max)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
x = a
y = c
max = x * y
for x in range(a,b + 1):
  for y in range(c,d + 1):
    if x * y > max:
      max = x * y
print(max)
Problem p02711 (python)

Fixed submission:
input_string = input()
yes = 0
for n in input_string:
  if n == '7':
    print('Yes')
    yes = 1
    break
if not yes:
  print('No')

Buggy submission (verdict: Runtime Error):
input_string = input()
while n < len(input_string):
  if n == '7':
    print('Yes')
    n += 1
    break
Problem p02552 (python)

Fixed submission:
if int(input())==1:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
inp = input()
if inp == 1:
print(0)
else:
print(1)

Buggy submission (verdict: Runtime Error):
if input() == 1:
print(0)
else:
print(1)

Buggy submission (verdict: Runtime Error):
if input() == "1":
print(0)
else:
print(1)

Buggy submission (verdict: Runtime Error):
if(input()) == 0:
print(0)
else:
print(1)

Buggy submission (verdict: Runtime Error):
if(input()) is 0:
print(0)
else:
print(1)
Problem p02552 (python)

Fixed submission:
print(abs(1-int(input())))

Buggy submission (verdict: Runtime Error):
print(abs(1-input()))
Problem p02552 (python)

Fixed submission:
a = int(input())
if a == 0:
    print('1')
else:
    print('0')

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
A = (a*c)
B = (a*d)  
C = (b*c)
D = (c*d)
MAX = A

if MAX < B:
    MAX = B
elif MAX < C:
    MAX = C
elif MAX < D:
    MAX = D

print(MAX)
Problem p02570 (python)

Fixed submission:
d,t,s = map(int, input().split())  
time = d/s
if time <= t:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
d,t,s = map(double, input().split())  
time = d/s
if time > t:
    print("Yes")
else:
    print("No")
Problem p02624 (python)

Fixed submission:
n=int(input())
ans = 0
for i in range(1, n+1):
    ans += (n//i) * ((n//i)+1)//2*i;
print(ans)

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

Fixed submission:
n,k = input().split()
s = input()
n = int(n)
k = int(k)
a = list(s)
a[k-1] = a[k-1].lower()
print(''.join(a))

Buggy submission (verdict: Runtime Error):
s = str(input())
first = s[0] + s[1]
second = s[2] + s[3]
if int(first) <= 12 and int(first) > 0 and (int(second) > 12 or int(second) == 0):
    print("MMYY")
elif int(second) <= 12 and int(second) > 0 and (int(first) > 12 or int(first) == 0):
    print("YYMM")
elif int(second) <= 12 and int(second) > 0 and int(first) <= 12 and int(first) > 0:
    print("AMBIGUOUS")
else:
    print("NA")
Problem p02685 (python)

Fixed submission:
N,M,K = map(int, input().split())
MOD = 998244353

fact = [1]
rfact = [1]
for i in range(1, N+1):
    fact.append(fact[i-1]*i%MOD)
    rfact.append(pow(fact[i], MOD-2, MOD))
 
def cmb(n, m):
    return fact[n]*rfact[m]*rfact[n-m]%MOD

answer = 0
for i in range(K+1):
    answer += (M*cmb(N-1,i)*pow(M-1,N-1-i,MOD))%MOD
print(answer%MOD)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
N,M,K = map(int, input().split())
answer = 0
for i in range(K+1):
    answer += M*comb(N-1,i, exact=True)*(M-1)**(N-1-i)*1**i
print(answer%998244353)
Problem p02948 (python)

Fixed submission:
import heapq
N,M = map(int,input().split())
AB_s = [list(map(int, input().split())) for _ in range(N)]
MAPperA = {i: [] for i in range(1,M+1)}
# 残り日数ごとのマップを作る
for i, AB in enumerate(AB_s):
    if AB[0] in MAPperA:
        MAPperA[AB[0]].append(AB[1])
excutableJobList = []
heapq.heapify(excutableJobList)
answer = 0
# 短期間でできる仕事からリストを作って追加してそーとして最大値を追加していく
for i in range(1,M+1):
    for j in MAPperA[i]:
        heapq.heappush(excutableJobList, j*-1)
    if excutableJobList:
        answer += heapq.heappop(excutableJobList) * -1
print(answer)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
# AB_s = [list(map(int,input().split())) for _ in range(N)]
dicts = {i:[] for i in range(1,M+1)}
for _ in range(N):
    A,B = map(int,input().split())
    if A in dicts:
        dicts[A].append(B)
answer = 0
wages = []
for i in range(1,M+1):
    wages.extend(dicts[i])
    if wages:
        wages.sort()
        if len(wages) > M-i:
            wages[M-i:] = []
        answer += wages.pop()
print(answer)
# AB_s = sorted(AB_s, key=lambda x:-x[0])
# print(AB_s)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
# AB_s = [list(map(int,input().split())) for _ in range(N)]
dicts = {i:[] for i in range(1,M+1)}
for _ in range(N):
    A,B = map(int,input().split())
    dicts[A].append(B)
answer = 0
wages = []
for i in range(1,M+1):
    wages.extend(dicts[i])
    if wages:
        wages.sort()
        answer += wages.pop()
print(answer)
# AB_s = sorted(AB_s, key=lambda x:-x[0])
# print(AB_s)
Problem p02989 (python)

Fixed submission:
# coding: utf-8
# Your code here!
N = int(input())
d_s = list(map(int,input().split()))
d_s.sort()
print(d_s[len(d_s)//2]-d_s[len(d_s)//2-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
d_s = list(map(int,input().split()))
d_s.sort()
print(d_s[len(d_s)]-d_s[len(d_s)-1])
Problem p03012 (python)

Fixed submission:
N = int(input())
W = list(map(int,input().split()))
cumsum_b,cumsum_e = [],[]

for i,w in enumerate(W):
  if i == 0:
    cumsum_b.append(w)
  else:
    cumsum_b.append(w+cumsum_b[i-1])
    
for i,w in enumerate(reversed(W)):
  if i == 0:
    cumsum_e.append(w)
  else:
    cumsum_e.append(w+cumsum_e[i-1])

answer = 10**9
for i in range(N-1):
  if answer > abs(cumsum_b[i]-cumsum_e[N-i-2]):
    answer = abs(cumsum_b[i]-cumsum_e[N-i-2])
print(answer)

Buggy submission (verdict: Runtime Error):
N = int(input())
W = list(map(int,input().split()))
cumsum_b,cumsum_e = [],[]

for i,w in enumerate(W):
  if i == 0:
    cumsum_b.append(w)
  else:
    cumsum_b.append(w+cumsum_b[i-1])
    
for i,w in enumerate(reversed(W)):
    if i == 0:
    cumsum_e.append(w)
  else:
    cumsum_e.append(w+cumsum_e[i-1])

answer = 10**9
for i in range(N-1):
  if answer > abs(cumsum_b[i]-cumsum[N-i-1]):
    answer = abs(cumsum_b[i]-cumsum[N-i-1])
print(answer)
Problem p03038 (python)

Fixed submission:
N,M = map(int,input().split())
A_s = list(map(int,input().split()))
BC_s = []
for _ in range(M):
  tempB,tempC = map(int,input().split())
  BC_s.append([tempB,tempC])
BC_s = reversed(sorted(BC_s, key=lambda x:x[1]))
D = []
A_s = sorted(A_s)

A_s_size = N
for BC in BC_s:
    B = BC[0]
    C = BC[1]
    if A_s_size == 0:
        break
    elif A_s_size < B:
        D.extend([C]*A_s_size)
        A_s_size -= A_s_size
    else:
        D.extend([C]*B)
        A_s_size -= B
minLength = min(N,len(D))
for i in range(minLength):
    if A_s[i] < D[i]:
        A_s[i] = D[i]
    else:
        break
print(sum(A_s[-N:]))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A_s = list(map(int,input().split()))
A_s = sorted(A_s)
for _ in M:
  B,C = map(int,input().split())
  limit = -1
  for i in range(B):
    if A_s[i] > C:
      break
    else:
      limit = i+1
  A_s[:limit] = [C] * limit
  A_s = sorted(A_s)
print(A_s)
Problem p02659 (python)

Fixed submission:
a,b = map(float,input().split())
a=int(a)
b=int(100*(b+0.001))
print(a*b//100)

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

Fixed submission:
n,m = map(int,input().split())
li=list(map(int,input().split()))
if m>=n:
    print(0)
else:
    li.sort()
    print(sum(li[:n-m]))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
li=list(map(int,input().split()))
if m>=n:
    print(0)
else:
    sort(li)
    print(sum(li[n-m:]))
Problem p03137 (python)

Fixed submission:
a,b = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
ls=[]
for i in range(b-1):
    ls.append(lis[i+1]-lis[i])
ls.sort(reverse=True)
print(sum(ls[a-1:]))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
ls=[]
for i in range(b-1):
  ls.append(lis[i+1]-lis[i])
ls.sort()
print(sum(ls[n-1:])
Problem p02552 (python)

Fixed submission:
c = int(input())
if c == 0:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
s = int(input())
l = 10**9+7
list_1 = [0, 1, 1, 1]
list_2 = [0, 1, 2]
for i in range(3, s):
  list_2.append((list_2[i-1] + list_1[i])%l)
  list_1.append(list_2[i-2])
if s = 1 or s = 2:
  print(0)
else:
  print(list_1[s-1])
Problem p02951 (python)

Fixed submission:
a, b, c = map(int, input().split())
if b + c <= a:
  print(0)
else:
  print(b + c - a)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [map(int, input().split())]
s = 1
for i in range(n):
  flag = 0
  for j in range(n-1-i):
    if h[j] <= h[n-1-i] + 1:
      flag += 0
    else:
      flag += 1
  if flag != 0:
    s *= 0
if s = 0:
  print("No")
else:
  print("Yes")
Problem p02577 (python)

Fixed submission:
N = int(input())
 
if N%9 == 0:
  print('Yes')
else:
  print('No')

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

if N%9 == 0:
  print(Yes)
else:
  print(No)
Problem p02594 (python)

Fixed submission:
X = int(input())
 
if X >= 30:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
X = int(input())

if X => 30:
  print('Yes')
else:
  print('No')
Problem p02699 (python)

Fixed submission:
s,w=map(int,input().split())
if w>=s:
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
s,w=map(int,input.split())
if w>=s:
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
s,w=map(int,input().split())
if w>=s:
  print("unsafe")
 else:
  print("safe")
Problem p02552 (python)

Fixed submission:
x = int(input())
if x == 0:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
x = int(input(x))
if x == 0:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
x = int(input(x))
if x == 1:
  print(0)
else:
  print(1)
Problem p02623 (python)

Fixed submission:
from itertools import accumulate

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

a_acc = [0] + list(accumulate(a))  # aを0冊読む=1冊も読まない場合があるので
b_acc = [0] + list(accumulate(b))  # 今度は[0]が必要です

ans = 0
for an in range(n + 1):
    rem = k - a_acc[an]
    if rem < 0:
        break

    # 最初は 0 <= x < m + 1 の範囲で、この範囲を狭めていきます
    ok = 0
    ng = m + 1   
    # ng = ok + 1のとき、ok <= x < ng は ok <= x < ok + 1で、x = okに確定します
    while abs(ng - ok) > 1:
        mid = (ok + ng) // 2
        # bをmid冊読めるか？
        if b_acc[mid] <= rem:
        # 読めるならok
            ok = mid
        else:
        # 読めないならng
            ng = mid

    bn = ok
    ans = max(ans, an + bn)

print(ans)

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
using namespace std;
typedef long long ll;

int N, M;
ll K;
vector<ll> A;
vector<ll> B;

bool is_ok(vector<ll> B, int cnt_a, int mid){
  return A[cnt_a] + B[mid] <= K;
}

int binary_search(vector<ll> B, int cnt_a) {
    int left = -1; // 配列の左端
    int right = B.size(); // 配列の右端
    // 両端の差が1になるまで続ける
    while (right - left > 1){
        int mid = (right + left) / 2; // 区間の真ん中
        if (is_ok(B, cnt_a, mid)) left = mid;  // もし調べている対象が「is_okの条件」に当てはまればleftをmidまで移動
        else right = mid;  // 当てはまらなければrightをmid-1に移動
    }
    return left;
}

int main(){
  cin >> N >> M >> K;
  // 0インデックスには何も読まない0という初期値をそのまま入れておく
  A.push_back(0);
  B.push_back(0);

  rep(i, N){
    ll a;
    cin >> a;
    A.push_back(a);
  }
  rep(i, M){
    ll b;
    cin >> b;
    B.push_back(b);
  }

  rep(i, N) A[i+1] += A[i];
  rep(i, M) B[i+1] += B[i];

  int ans = 0;
  int cnt_b;
  rep(cnt_a, N+1){
    if (A[cnt_a] > K) continue;
    cnt_b = binary_search(B, cnt_a);
    ans = max(ans, cnt_a + cnt_b);
  }
  cout << ans << endl;
}
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
A, B = map(str, input().split())

A = Decimal(A)
B = Decimal(B)

print(int(A*B))

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

N = int(input())
A = list(map(int, input().split()))

A = np.array(A).dtype(np.int64)

ans = int(np.prod(A))

if ans > 10**18:
  print(-1)
else:
  print(ans)
Problem p02552 (python)

Fixed submission:
def f(x):
	if x == 0:
		return 1
	elif x == 1:
		return 0


n = float(input())
r = f(n)
if r != None:
	print(r)

Buggy submission (verdict: Runtime Error):
def f(x):
  if (x == 0):
    return 1
  else if (x == 1):
    return 0

  
f(int(input())
Problem p02594 (python)

Fixed submission:
x = int(input())
if x >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x = int(input())
if x > 30:
  print("Yes")
else
  print("No")
Problem p02629 (python)

Fixed submission:
n = int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"
n_rem = n
ans = ""
 
while True:
  x = n_rem % 26
  if x == 0:
      x = 26
  ans += chars[x]
  n_rem -= x
  if n_rem == 0:
    break
  n_rem //= 26
  
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
n = input()
chars = "Xabcdefghijklmnopqrstuvwxyz"
n_rem = n
ans = ""
 
while True:
  x = n_rem % 26
  if x == 0:
      x = 26
  ans += chars[x]
  n_rem -= x
  if n_rem == 0:
    break
  n_rem //= 26
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
n = input()
chars = "Xabcdefghijklmnopqrstuvwxyz"
n_rem = n
ans = ""

while True:
  x = n_rem % 26
  if x == 0:
    x = 26
  ans += chars[x]
  n_rem -= 26
  if n_rem == 0:
    break
  n_rem //= 26
print(ans[::-1])
Problem p02676 (python)

Fixed submission:
k=int(input())
s=str(input())
if len(s) <= k:
  print(s)
else:
  print(s[0:k] + "...")

Buggy submission (verdict: Runtime Error):
k=int(input())
s=str(input())
if len(s) <= k:
  print(s)
else:
  print(s in range k + "...")
Problem p02682 (python)

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

result = 0
t = min(A, K)
result += t
K -= t
t = min(B, K)
K -= t
t = min(C, K)
result -= t
print(result)

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
if K <= A:
  print(K)
else if A+B >= K:
  print(A)
else:
  print(A-(K-A-B))

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
if A >= K:
  print(K)
else if A+B >= K:
  print(A)
else:
  print(A-(K-A-B))

Buggy submission (verdict: Runtime Error):
A,B,C,K=map(int, input().split())
if A >= K:
  print(K)
else if A+B >= K:
  print(A)
else:
  print(A-(K-A-B))
Problem p02688 (python)

Fixed submission:
n, k = map(int, input().split())
 
t = [0]*n
for i in range(k):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    t[a - 1] += 1
print(t.count(0))

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

t = [0]*n
for i in range(k):
  d = int(input())
  A = list(map(int, input().split()))
  for a in range A:
    t[a - 1] += 1
print(t.count(0))
Problem p02693 (python)

Fixed submission:
k = int(input())
a, b = map(int, input().split())
 
for i in range(a,b+1):
  if i%k == 0:
    print("OK")
    break
else:
  print("NG")

Buggy submission (verdict: Runtime Error):
k = input()
a, b = map(int, input().split())
 
for i in range(a,b):
  if i%k == 0:
    print("OK")
    break
else:
  print("NG")

Buggy submission (verdict: Runtime Error):
k = input()
a, b = map(int, input().split())
 
for i in range(a,b+1):
  if i%k == 0:
    print("OK")
    break
else:
    print("NG")

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

for i in range(a,b+1):
  if i%k == 0:
    print("OK")
    break
  else:
    print("NG")
Problem p02552 (python)

Fixed submission:
n = int(input())
if n == 0:
    print("1")
else:
    print("0")

Buggy submission (verdict: Runtime Error):
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]

a = 0
for i in range(0,n):
    for j in range(1,n-i):
        c = abs(x[i] - x[i + j]) + abs(y[i] - y[i + j])
        print(c)
        if a >= c:
            a = a
        else:
            a = c
print(a)
Problem p02627 (python)

Fixed submission:
S = input()
if (S.isupper()) == True:
    print ('A')
else:
    print ('a')

Buggy submission (verdict: Runtime Error):
n = input()
m = n.split()
print(m)
a = [input() for l in range(0,1)]
b = a[0].split()
print(b)

for i in range(0, len(b)):
    b[i] = int(b[i])

c = sorted(b, reverse=True)
print(c)
p = 0
for i in range(int(m[0]) - int(m[1]),int(m[0])):
    p = p + int(c[i])
print(int(p))
Problem p02596 (python)

Fixed submission:
import sys
k = int(input())

a = [0]*k
a[0] = 7 % k

for i in range(1, k):
    a[i] = (10*a[i-1]+7) % k

for i in range(k):
    if a[i] == 0:
        print(i+1)
        sys.exit()
print(-1)

Buggy submission (verdict: Runtime Error):
k = int(input())

a = [0]*k
a[0] = 7
cnt = 0

for i in range(1, k):
    a[i] = (10*a[i-1]+7) % k

print(a.index(0) + 1 if k % 2 != 0 else -1 )
Problem p02987 (python)

Fixed submission:
def func():
    input_line = list(str(input('')))
    flag = 0
    for i in range(len(input_line)):
        for j in range(i+1,len(input_line)):
            if input_line[i] == input_line[j]:
                flag += 1
    if flag == 2:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    func()

Buggy submission (verdict: Runtime Error):
    input_line = list(str(input('Put any literal: ')))
    for i in range(len(input_line)):
        for j in range(i+1,len(input_line)):
            if input_line[i] == input_line[j]:
                print('Yes')
                return
    print('No')
Problem p02594 (python)

Fixed submission:
rt = int(input())

if rt >=30:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
rt = int(inut())

if rt >= 30:
    print("Yes")
else:
    print("No")
Problem p02879 (python)

Fixed submission:
a,b = map(int, input().split( ))
if 1 <= a <= 9 and 1 <= b <= 9:
  print(a*b)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
a.b = list(map(int, input().split( )))
if 1 <= a <= 9 and 1 <= b <= 9:
  print(a*b)
else:
  print(-1)
Problem p02880 (python)

Fixed submission:
n = int(input())
a = []
for i in range(1,10):
  for j in range(1,10):
    a.append(i*j)
if n in a:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = set()
for i in range(1,10):
  for j in range(1,10):
    a.append(i*j)
if n in a:
  print('Yes')
else:
  print('No')
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, inpuy().split( ))
d = a-b
print(min(c-d, 0))
Problem p02570 (python)

Fixed submission:
d,t,s =map(int,input().split())
if d/s <=t :
    print('Yes')
else :
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
re = 0
re2 = 0

for i in range(n):
    re += a[i]*sum(a[i+1:])
    #for m in range(n-i-1):
        #re = a[i]*a[i+m+1]
        #re2 += re

ans = re %1000000007
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
re = 0
re2 = 0

for i in range(n):
    for m in range(n-i-1):
        re = a[i]*a[i+m+1]
        re2 += re

ans = re2 %1000000007
print(ans)

Buggy submission (verdict: Runtime Error):
s=list(input())
t=list(input())
result=0
#count=0
for i in range(len(s)-len(t)+1) :
    count=0
    for n in range(len(t)):
        if s[i+n]==t[n]:
            count += 1
        #s[i:i+len(t)] == t
    
    if count>result:
        result=count


print(len(t)-result)

Buggy submission (verdict: Runtime Error):
d,t,s =map(int,input().split())
if d%s <=t :
    print(Yes)
else :
    print(No)