Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
n = 7

if k % 2 == 0 or k % 5 == 0:
    print(-1)
    exit()

ans = 1
while True:
    if n % k == 0:
        print(ans)
        exit()
    n = (n*10 + 7)
    ans += 1

Fixed submission:
k = int(input())
n = 7

if k % 2 == 0 or k % 5 == 0:
    print(-1)
    exit()

ans = 1
while True:
    if n % k == 0:
        print(ans)
        exit()
    n = (n*10 + 7)%k
    ans += 1

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
n = 7

if k % 2 == 0 or k % 5 == 0:
    print(-1)
    exit()

ans = 1
while True:
    if n % k == 0:
        print(ans)
        exit()
    n = (n*10 + 7)
    ans += 1

Fixed submission:
k = int(input())
n = 7

if k % 2 == 0 or k % 5 == 0:
    print(-1)
    exit()

ans = 1
while True:
    if n % k == 0:
        print(ans)
        exit()
    n = (n*10 + 7)%k
    ans += 1
Buggy python submission (verdict: Time Limit Exceeded):
m, n, k = map(int, input().split())
a = [0] + list(map(int, input().split()))
b = [0] + list(map(int, input().split()))

def check_(lis, num, ti):
    ans = 0
    for i in range(num+1):
        if ans >= ti:
            break
        ans +=  lis[i]
    return i

max_a = check_(a, m, k)
max_b = check_(b, n, k)
ans = 0
for i in range(max_a+1):
    for j in range(max_b+1):
        if sum(a[:i+1]) + sum(b[:j+1]) <= k and i + j > ans:
            ans = i+j 
print(ans)

Fixed submission:
n, m, k = map(int, input().split())
A = [0] + list(map(int,input().split()))
B = [0] + list(map(int,input().split()))
 
for i in range(2,n+1):
    A[i] += A[i-1]
for i in range(2,m+1):
    B[i] += B[i-1]

j = m
ans = 0
for i in range(n+1):
    if A[i] > k:
        break 
    while B[j] > k-A[i]:
        j -= 1
    ans = max(ans, i+j)
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
flag == 100
while flag ==100:
    C -= B
    if flag==100 and C<=0:
        flag = 0
    A -= D
    if flag==100 and A<=0:
        flag = 1
if flag==0: print('Yes')
else: print('No')

Fixed submission:
A, B, C, D = map(int, input().split())
flag = 100
while flag ==100:
    C -= B
    if flag==100 and C<=0:
        flag = 0
    A -= D
    if flag==100 and A<=0:
        flag = 1
if flag==0: print('Yes')
else: print('No')
Buggy python submission (verdict: Runtime Error):
from functools import reduce
import math

N = int(input())
sum = 0
def gcd(*numbers):
    return reduce(math.gcd, numbers)

for i in range(1,N+1):
    for j in range(1, N+1):
        for k in range(1, N+1):
            sum += gcd(i,j,k)
            b.sort()
            a.append(b)
print(sum)

Fixed submission:
from functools import reduce
import math

N = int(input())
sum = 0
def gcd(*numbers):
    return reduce(math.gcd, numbers)

for i in range(1,N+1):
    for j in range(1, N+1):
        for k in range(1, N+1):
            sum += gcd(i,j,k)
print(sum)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split())).sort()
sum_ = 0
for i in a:
    sum_ +=i
if(a[m-1]>(sum_/4*m)):
    print('Yes')
else: print('No')

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
sum_ = 0
for i in a:
    sum_ +=i
if(a[m-1]>=sum_/(4*m)):
    print('Yes')
else: print('No')
Buggy python submission (verdict: Runtime Error):
def pal(string):
    return True if string==string[::-1] else False

S = input()

if palindrome(S) and palindrome(S[0:int((len(S)-1)/2)]) and palindrome(S[int((len(S)+3)/2)-1:]):
    print('Yes')
else:
    print('No')

Fixed submission:
def pal(string):
    return True if string==string[::-1] else False

S = input()

if pal(S) and pal(S[0:int((len(S)-1)/2)]) and pal(S[int((len(S)+3)/2)-1:]):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import numpy as np
a, b, c = map(int, input().split())

A = a+b-c+2*np.sqrt(np.around(a*b, 10))
if A < 0:
    print('Yes')
else:
    print('No')

Fixed submission:
from decimal import *

a, b, c = map(int, input().split())

A = Decimal(str(a)).sqrt()+Decimal(str(b)).sqrt()-Decimal(str(c)).sqrt()
if A < 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
S = ''
a = 'b'*A+'r'*B
count=int(N/len(a))+N//len(a)
S = a*count
print(S[:N].count('b'))

Fixed submission:
N, A, B = map(int, input().split())
d = N//(A+B)
p = N%(A+B)

S = d*A + min(p, A)
print(S)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
S = ''
a = 'b'*A+'r'*B
count=int(N/len(a))+N//len(a)
for i in range(0,count):
    S += a
print(S[:N].count('b'))

Fixed submission:
N, A, B = map(int, input().split())
d = N//(A+B)
p = N%(A+B)

S = d*A + min(p, A)
print(S)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
S = ''
r = 'r'*B
b = 'b'*A
while len(S) < N+5:
    S += b
    S += r
print(S[:N].count('b'))

Fixed submission:
N, A, B = map(int, input().split())
d = N//(A+B)
p = N%(A+B)

S = d*A + min(p, A)
print(S)
Buggy python submission (verdict: Runtime Error):
flag = 0
for i  in a:
    if i in A:
        A[A.index(i)] = "0"
B = []
C = []
D = []
E = []
F = []
for i in range(3):
    B.append(A[4*i])
    C.append(A[2*(i+1)])
    D.append(A[3*i])
    E.append(A[3*i+1])
    F.append(A[3*i+2])
    if "0" in A[i*3:i*3+3]:
        if A[i*3:i*3+3].count("0") == 3:
            flag = 1
if "0" in B:
    if B.count("0") == 3:
        flag = 1
if"0"in C:
    if C.count("0") == 3:
        flag = 1
if"0"in D:
    if D.count("0") == 3:
        flag = 1
if"0"in E:
    if E.count("0") == 3:
        flag = 1
if"0"in F:
    if F.count("0") == 3:
        flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")

Fixed submission:
A = list(map(str, input().split()))
A += list(map(str, input().split()))
A += list(map(str, input().split()))
a = []
N = int(input())
for i in range(N):
    a.append(input())
flag = 0
for i  in a:
    if i in A:
        A[A.index(i)] = "0"
B = []
C = []
D = []
E = []
F = []
for i in range(3):
    B.append(A[4*i])
    C.append(A[2*(i+1)])
    D.append(A[3*i])
    E.append(A[3*i+1])
    F.append(A[3*i+2])
    if "0" in A[i*3:i*3+3]:
        if A[i*3:i*3+3].count("0") == 3:
            flag = 1
if "0" in B:
    if B.count("0") == 3:
        flag = 1
if"0"in C:
    if C.count("0") == 3:
        flag = 1
if"0"in D:
    if D.count("0") == 3:
        flag = 1
if"0"in E:
    if E.count("0") == 3:
        flag = 1
if"0"in F:
    if F.count("0") == 3:
        flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
A = list(map(str, input().split()))
A += list(map(str, input().split()))
A += list(map(str, input().split()))
a = []
N = int(input())
for i in range(7):
    a.append(input())
flag = 0
for i  in a:
    if i in A:
        A[A.index(i)] = "0"
B = []
C = []
for i in range(3):
    B.append(A[4*i])
    C.append(A[2*i])
    if "0" in A[i*3:i*3+3]:
        if A.count("0") == 3:
            flag = 1
if "0" in B:
    if B.count("0") == 3:
        flag = 1
if"0"in C:
    if C.count("0") == 3:
        flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")

Fixed submission:
A = list(map(str, input().split()))
A += list(map(str, input().split()))
A += list(map(str, input().split()))
a = []
N = int(input())
for i in range(N):
    a.append(input())
flag = 0
for i  in a:
    if i in A:
        A[A.index(i)] = "0"
B = []
C = []
D = []
E = []
F = []
for i in range(3):
    B.append(A[4*i])
    C.append(A[2*(i+1)])
    D.append(A[3*i])
    E.append(A[3*i+1])
    F.append(A[3*i+2])
    if "0" in A[i*3:i*3+3]:
        if A[i*3:i*3+3].count("0") == 3:
            flag = 1
if "0" in B:
    if B.count("0") == 3:
        flag = 1
if"0"in C:
    if C.count("0") == 3:
        flag = 1
if"0"in D:
    if D.count("0") == 3:
        flag = 1
if"0"in E:
    if E.count("0") == 3:
        flag = 1
if"0"in F:
    if F.count("0") == 3:
        flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N = int(input())
A = list(input().split())
flag = 0
for i in range(0, N):
    for j in range(0, N):
        if i!=j and A[i] == A[j]:
            flag = 1
if flag == 1:
    print("NO")
    sys.stdout.flush
else:
    print("YES")
    sys.stdout.flush

Fixed submission:
import sys
N = int(input())
A = list(input().split())
def has(s):
    return len(s) != len(set(s))
B = A
B = has(A) 
if B == False:
    print("YES")
    sys.stdout.flush
else:
    print("NO")
    sys.stdout.flush
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
D = list(map(str, input().split()))
for i in range(n, 100000):
    s = list(str(i))
    flg = 0
    for j in s:
        if j in d:
            flg = 1
            break
    if flg == 0:
        print("".join(s))
        break

Fixed submission:
N, K = map(int, input().split())
D = list(map(str, input().split()))
for i in range(N, 100000):
    s = list(str(i))
    flg = 0
    for j in s:
        if j in D:
            flg = 1
            break
    if flg == 0:
        print("".join(s))
        break
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

A,B,Q = map(int,input().split())
S = [int(input()) for i in range(A)]
T = [int(input()) for i in range(B)]

for i in range(Q):
	x = int(input())
	ids = bisect.bisect_left(S,x)
	idt = bisect.bisect_left(T,x)
	ans = 0
	sl = -10000000000000000
	sr = 10000000000000000
	tl = -10000000000000000
	tr = 10000000000000000
	if ids!=0:
		sl = S[ids-1]
	if ids!=A:
		sr = S[ids]
	if idt!=0:
		tl = T[idt-1]
	if idt!=B:
		tr = T[idt]
	ans = min(max(sr,tr)-x,x-min(sl,tl))
	ans = min(ans,2*abs(x-sl)+abs(x-tr),abs(x-sl)+2*abs(x-tr),2*abs(x-sr)+abs(x-tl),abs(x-sr)+2*abs(x-tl))
	print(ans)


Fixed submission:
import bisect

A,B,Q = map(int,input().split())
S = [int(input()) for i in range(A)]
T = [int(input()) for i in range(B)]

for i in range(Q):
	x = int(input())
	ids = bisect.bisect_left(S,x)
	idt = bisect.bisect_left(T,x)
	ans = 0
	sl = -10000000000000000
	sr = 10000000000000000
	tl = -10000000000000000
	tr = 10000000000000000
	if ids!=0:
		sl = S[ids-1]
	if ids!=A:
		sr = S[ids]
	if idt!=0:
		tl = T[idt-1]
	if idt!=B:
		tr = T[idt]
	ans = min(max(sr,tr)-x,x-min(sl,tl))
	ans = min(ans,2*abs(x-sl)+abs(x-tr),abs(x-sl)+2*abs(x-tr),2*abs(x-sr)+abs(x-tl),abs(x-sr)+2*abs(x-tl))
	print(ans)
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
using namespace std;

int N,M;
int A[10],num[10] = {0,2,5,5,4,5,6,3,7,6};
vector<int> B;
vector<string> v;

void dfs(int n,string S){
	if(n==0) v.push_back(S);
	else{
		for(int i=0;i<(int) B.size();i++){
			char c = '0'+B[i];
			if(n-num[B[i]]>=0) dfs(n-num[B[i]],S+c);
		}
	}
}

int main(){
	cin >> N >> M;
	int cnt = 100;
	int a;
	for(int i=1;i<=M;i++){
		cin >> A[i];
		if(cnt>=num[A[i]]){
			cnt = num[A[i]];
			a = A[i];
		}
	}
	set<int> s;
	sort(A+1,A+M+1,greater<int>());
	for(int i=1;i<=M;i++){
		if(s.count(num[A[i]])==0){
			B.push_back(A[i]);
			s.insert(num[A[i]]);
		}
	}
	string ans;
	while(N-cnt>=0){
		char c = '0'+a;
		ans = ans+c;
		N -= cnt;
	}
	for(int i=0;i<(int) B.size();i++){
		if(N-num[B[i]]==0){
			char c = '0'+B[i];
			if(B[i]>a) ans = c+ans;
			else ans = ans + c;
			cout << ans << endl;
			return 0;
		}
	}
	string now = ans;
	int l = ans.size();
	ans = "";
	int c = 0;
	while(c<=min(l-1,7)){
		now.erase(now.begin()+(int) now.size()-1);
		c++;
		N += cnt;
		dfs(N,"");
		for(int i=0;i<(int) v.size();i++){
			string s1 = now+v[i],s2 = v[i]+now;
			if(ans.size()>s1.size()) continue;
			if(s1>s2 && s1>ans) ans = s1;
			else if(s2>s1 && s2>ans) ans = s2;
		}
		v.clear();
	}
	cout << ans << endl;
}

Fixed submission:
N,M = map(int,input().split())
A = list(map(int,input().split()))
num = [0,2,5,5,4,5,6,3,7,6]

dp = [0]*(N+1)

for i in range(N+1):
	for j in range(len(A)):
		if i-num[A[j]]<0:
			continue
		if i-num[A[j]]>0 and dp[i-num[A[j]]]==0:
			continue
		dp[i] = max(dp[i],dp[i-num[A[j]]]+1)

A.sort()
A.reverse()
ans = ""
now = N
while now!=0:
	for i in range(len(A)):
		if now-num[A[i]]<0:
			continue
		if dp[now-num[A[i]]]==dp[now]-1:
			if dp[now-num[A[i]]]==0 and now-num[A[i]]!=0:
				continue
			ans = ans+str(A[i])
			now -= num[A[i]]
			break
print(ans)
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
print(max([a-b,a+b,a*b]))

Fixed submission:
a,b=map(int,input().split())
print(max([a-b,a+b,a*b]))
Buggy python submission (verdict: Time Limit Exceeded):
#Sが長いほう
N = int(input())
A = list(map(int, input().split()))

cnt = 0
for i in range(N-1): 
  for j in range(i+1,N):
    cnt += (A[i] * A[j])%(10**9+7)

print(cnt%(10**9+7))

Fixed submission:
#Sが長いほう
N = int(input())
A = list(map(int, input().split()))

cnt = 0
sumall = sum(A)
#print(sumall)
for i in range(N-1):
  sumall -= A[i]
  cnt += (A[i] * sumall )%(10**9+7)
print(cnt%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):

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

cnt = 0
for i in range(N-1): 
  for j in range(i+1,N):
    cnt += A[i] * A[j]

print(cnt%(10**9+7))

Fixed submission:
#Sが長いほう
N = int(input())
A = list(map(int, input().split()))

cnt = 0
sumall = sum(A)
#print(sumall)
for i in range(N-1):
  sumall -= A[i]
  cnt += (A[i] * sumall )%(10**9+7)
print(cnt%(10**9+7))
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())

cnt = 0
while(N>0):
  cnt += N%10
  N = int(N/10)
  #print(N)

if cnt%9 ==0:
	print('Yes')
else: print('No')

Fixed submission:
import math

#N = int(input())
N =list(input())
#print(N)
cnt = 0
for i in range(len(N)):
  cnt += int(N[i])
  #print(N)

if cnt%9 ==0:
	print('Yes')
else: print('No')
Buggy python submission (verdict: Runtime Error):
import math

#N = int(input())
N =int(input())
A =list(map(int, input().split())
        
#print(N)
cnt = 0
cur = A[0]
for i in range(1,N):
  if cur > A[i]:
    cnt += cur - A[i]
  else:
    cur = A[i]

print(cnt)

Fixed submission:
import math

#N = int(input())
N =int(input())
A =list(map(int, input().split()))
cnt = 0
cur = A[0]
for i in range(1,N):
  if cur > A[i]:
    cnt += cur - A[i]
  else:
    cur = A[i]

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):

X, K, D = map(int, input().split())
K2 = K
#X=１に近いものにおきかえる
if X >= 0:
  a= 1
else:
  a = -1
for i in range(K2):
  Y = X - a *D
  if a*Y< 0:
    break
  X=Y
  K-=1
  
#print(X, K, D)
      


flg = 0
minx = abs(X)
Xnow = X
Xprepre = 0
for i in range(K):
  if i != 0:
    Xprepre = Xpre
  Xpre = Xnow #前回
  X1 = Xnow -D
  X2 = Xnow +D
  if abs(X1) < abs(X2):
    Xnow = X1
  else:
    Xnow = X2
  #繰り返したらおわり
  if Xprepre == Xnow:
    flg = 1
    if (K-i+1)%2 == 0:
      print(abs(Xnow))
    else:
      print(abs(Xpre))
    break
if flg == 0:
  print(abs(Xnow))


Fixed submission:

X, K, D = map(int, input().split())
K2 = K
#X=１に近いものにおきかえる
if X >= 0:
  a= 1
else:
  a = -1
#何回引けるか
h = min(K, int(a*X/D))
K = K-h
X = X - a*D*h

#print(X, K, D)
      


flg = 0
minx = abs(X)
Xnow = X
Xprepre = 0
for i in range(K):
  if i != 0:
    Xprepre = Xpre
  Xpre = Xnow #前回
  X1 = Xnow -D
  X2 = Xnow +D
  if abs(X1) < abs(X2):
    Xnow = X1
  else:
    Xnow = X2
  #繰り返したらおわり
  if Xprepre == Xnow:
    flg = 1
    if (K-i+1)%2 == 0:
      print(abs(Xnow))
    else:
      print(abs(Xpre))
    break
if flg == 0:
  print(abs(Xnow))

Buggy python submission (verdict: Time Limit Exceeded):

X, K, D = map(int, input().split())

flg = 0
minx = abs(X)
Xnow = X
Xprepre = 0
for i in range(K):
  if i != 0:
    Xprepre = Xpre
  Xpre = Xnow #前回
  X1 = Xnow -D
  X2 = Xnow +D
  if abs(X1) < abs(X2):
    Xnow = X1
  else:
    Xnow = X2
  #繰り返したらおわり
  if Xprepre == Xnow:
    flg = 1
    if (K-i+1)%2 == 0:
      print(abs(Xnow))
    else:
      print(abs(Xpre))
    break
if flg == 0:
  print(abs(Xnow))


Fixed submission:

X, K, D = map(int, input().split())
K2 = K
#X=１に近いものにおきかえる
if X >= 0:
  a= 1
else:
  a = -1
#何回引けるか
h = min(K, int(a*X/D))
K = K-h
X = X - a*D*h

#print(X, K, D)
      


flg = 0
minx = abs(X)
Xnow = X
Xprepre = 0
for i in range(K):
  if i != 0:
    Xprepre = Xpre
  Xpre = Xnow #前回
  X1 = Xnow -D
  X2 = Xnow +D
  if abs(X1) < abs(X2):
    Xnow = X1
  else:
    Xnow = X2
  #繰り返したらおわり
  if Xprepre == Xnow:
    flg = 1
    if (K-i+1)%2 == 0:
      print(abs(Xnow))
    else:
      print(abs(Xpre))
    break
if flg == 0:
  print(abs(Xnow))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

inf=10**7
n=int(input())
coin=[6**x for x in range(10)]
coin+=[9**x for x in range(1,10)]

dp=np.zeros(n+1,dtype=np.int64)
dp+=inf
dp[0]=0

for i in range(n+1):
    for x in coin:
        if(i+x<=n):
            dp[i+x]=min(dp[i+x],dp[i]+1)
print(dp[-1])

Fixed submission:

inf=10**7
n=int(input())

ad=[6**x for x in range(10)]
ad2=[9**x for x in range(1,10)]
ad.extend(ad2)

a=[inf]*(n+1)
a[0]=0
for i in range(n+1):
    for x in ad:
        if(x+i<=n):a[x+i]=min(a[x+i],a[i]+1)



print(a[n])
Buggy python submission (verdict: Runtime Error):
X=int(input())
li=[x**p for x in range(2,32) for p in range(2,35) if x**p<=X]
print(max(li))

Fixed submission:
X=int(input())
li=[x**p for x in range(1,32) for p in range(2,35) if x**p<=X]
print(max(li))
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;

#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
 
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}

void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
////////////////////////////

int main(){fastio
    
    return 0;
}


Fixed submission:


import numpy as np

s=sorted(input())

if(s==list("abc")):print("Yes")
else:print("No")
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int,input().split())
for i in range(a,b+1):
    if(abs(a-i)<k or abs(b-i)<k):
        print(i)

Fixed submission:
a,b,k=map(int,input().split())
se=set(set(range(a,a+k))|set(range(b-k+1,b+1)))
li=[x for x in se if a<=x<=b]
li=sorted(li)
print(*li,sep="\n")

Buggy python submission (verdict: Time Limit Exceeded):


import numpy as np

a,b,k=map(int,input().split())
for i in range(a,b+1):
    if(i-a<k or b-i<k):
        print(i)
        

Fixed submission:
a,b,k=map(int,input().split())
se=set(set(range(a,a+k))|set(range(b-k+1,b+1)))
li=[x for x in se if a<=x<=b]
li=sorted(li)
print(*li,sep="\n")
Buggy python submission (verdict: Time Limit Exceeded):


import numpy as np

n=int(input())
for i in range(10**9):
    if(i*i>n):
        print((i-1)**2)

Fixed submission:


import numpy as np

n=int(input())
for i in range(10**9):
    if(i*i>n):
        print((i-1)**2)
        exit(0)
Buggy python submission (verdict: Runtime Error):


#import numpy as np

n,a=map(int,input().split())
print(n*n-a)

Fixed submission:


import numpy as np

n=int(input())
a=int(input())
print(n*n-a)

Buggy python submission (verdict: Runtime Error):


import numpy as np

n,a=map(int,input().split())
print(n*n-a)

Fixed submission:


import numpy as np

n=int(input())
a=int(input())
print(n*n-a)
Buggy python submission (verdict: Runtime Error):


import numpy as np
import fractions as fra

t=int(input())
ans=1
for _ in range(t):
    ans=ans*int(input())/fra.gcd(ans,int(input()))
print(ans)

Fixed submission:


import numpy as np

def gcd(a,b):
    if(a>b):
        a,b=b,a
    if(a==0):return b
    return gcd(b%a,a)

t=int(input())
ans=1
for _ in range(t):
    k=int(input())
    ans=ans*k//gcd(ans,k)
print(ans)
Buggy python submission (verdict: Runtime Error):


import numpy as np
import fractions as fra


h,w=map(int,input().split())
if(h+w>=10):
    print("error"):
else:
    print(h+w)

Fixed submission:

import numpy as np
import fractions as fra


h,w=map(int,input().split())
if(h+w>=10):
    print("error")
else:
    print(h+w)
Buggy python submission (verdict: Runtime Error):


import numpy as np
import fractions as fra



a[13]={0,3,1,3,2,3,2,3,3,2,3,2,3}

x,y=map(int,input().split())
if(a[x]==a[y]):
    print("Yes")
else:
    print("No")

Fixed submission:


import numpy as np
import fractions as fra



a=[0,3,1,3,2,3,2,3,3,2,3,2,3]

x,y=map(int,input().split())
if(a[x]==a[y]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):


import numpy as np
import math

a,b,c=map(int,input().split())

g=math.gcd(a,b)
if(c%g==0):
    print("YES")
else:
    print("NO")

Fixed submission:


import numpy as np
import fractions as fra

a,b,c=map(int,input().split())

g=fra.gcd(a,b)
if(c%g==0):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):


import numpy as np
import math


s=" "+input()
for i in range(len(s)):
    if(s[i]==" "):
        print(char((ord)s[i+1]-(ord)'a'+(ord)'A'),end="")
print()

Fixed submission:


import numpy as np
import math


s=" "+input()
for i in range(len(s)):
    if(s[i]==" "):
        print(chr(ord(s[i+1])-32),end="")
print()
Buggy python submission (verdict: Runtime Error):
import math

# input d:距離（メートル） , t:待ち合わせまで何分 , s:速度（分速sメートル）
d, t, s = map(int, input().split())

output = "";

if d/s >= s:
    if math.ceil(d/s) = s:
        output = "Yes"
    else:
        output = "No"
else:
    output = "Yes"

print(output)


Fixed submission:
import math

# input d:距離（メートル） , t:待ち合わせまで何分 , s:速度（分速sメートル）
d, t, s = map(int, input().split())

output = "";

if d/s > t:
    output = "No"
else:
    output = "Yes"

print(output)
Buggy python submission (verdict: Runtime Error):
x, k, d = ma-(int, input().split())
x = abs(x)

if x>k*d:
    print(x-k*d)
else:
    k-=x//d
    x-=(d*(x//d))
    and=[x,abs(d-x)]
    print(ans[k%2])

Fixed submission:
x,k,d=map(int,input().split())
x=abs(x)
if x>k*d:
    print(x-k*d)
else:
    k-=x//d
    x-=(d*(x//d))
    ans=[x,abs(d-x)]
    print(ans[k%2])

Buggy python submission (verdict: Runtime Error):
import math;

# input 現在座標ｘ, 移動回数k, 移動距離d
x, k, d = map(int, input().split())


a = math.floor(x / d);

if a > k:
    for i in range(k):
        if x > 0:
            x = x - d;
        elif x <= 0:
            x = x + d;

elif a <= k:
    # あまり
    s = k%a;
    
    for i in range(a+s):
        if x > 0:
            x = x - d;
        elif x <= 0:
            x = x + d;
            
# xが負の数の場合正の数に編集する
if x < 0:
    x = x * (-1);

print(x);

Fixed submission:
x,k,d=map(int,input().split())
x=abs(x)
if x>k*d:
    print(x-k*d)
else:
    k-=x//d
    x-=(d*(x//d))
    ans=[x,abs(d-x)]
    print(ans[k%2])

Buggy python submission (verdict: Time Limit Exceeded):
# input 現在座標ｘ, 移動回数k, 移動距離d
x, k, d = map(int, input().split())

# 現在座標が正ならば引き算、負なら足し算をする
for i in range(k):
    if x > 0:
        x = x - d;
    elif x <= 0:
        x = x + d;

# xが負の数の場合正の数に編集する
if x < 0:
    x = x * (-1);

print(x);


Fixed submission:
x,k,d=map(int,input().split())
x=abs(x)
if x>k*d:
    print(x-k*d)
else:
    k-=x//d
    x-=(d*(x//d))
    ans=[x,abs(d-x)]
    print(ans[k%2])
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

c = 1
d = 0
for b >= c:
    c = c+a-1
    d++
    
print(d)

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

c = 1
d = 0
while c < b:
    c = c+a-1
    d+=1
    
print(d)
Buggy python submission (verdict: Runtime Error):
if x == 0:
  print(1)
  
else:
  print(0)

Fixed submission:
x = int(input())

if x == 1:
  print(0)
 
else:
  print(1)