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

Fixed submission:
def getval():
    s = input()
    return s
    
def main(s):
    #dp for "a","ab","abc"
    mod = 10**9 + 7
    dp = [0,0,0,0]
    p3 = [1]
    for i in range(len(s)):
        p3.append((3*p3[i])%mod)
    for i in s:
        if i=="A":
            dp[0] += p3[dp[3]]
            dp[0] %= mod
        elif i=="B":
            dp[1] += dp[0]
            dp[1] %= mod
        elif i=="C":
            dp[2] += dp[1]
            dp[2] %= mod
        else:
            temp1 = dp[0]*2
            temp2 = dp[1]*2
            temp3 = dp[2]*2
            dp[2] += dp[1]
            dp[1] += dp[0]
            dp[0] += p3[dp[3]]
            dp[2] += temp3
            dp[1] += temp2
            dp[0] += temp1
            dp[3] += 1
            for j in range(3):
                dp[j] %= mod
            #print(dp)
    print(dp[2])

if __name__=="__main__":
    s = getval()
    main(s)

Buggy submission (verdict: Runtime Error):
def getval():
    s = input()
    return s
    
def main(s):
    #dp for "a","ab","abc"
    mod = 10**9 + 7
    dp = [0,0,0,0]
    p3 = [1]
    for i in range(n):
        p3.append((3*p3[i])%mod)
    for i in s:
        if i=="A":
            dp[0] += p3[dp[3]]
            dp[0] %= mod
        elif i=="B":
            dp[1] += dp[0]
            dp[1] %= mod
        elif i=="C":
            dp[2] += dp[1]
            dp[2] %= mod
        else:
            temp1 = dp[0]*2
            temp2 = dp[1]*2
            temp3 = dp[2]*2
            dp[2] += dp[1]
            dp[1] += dp[0]
            dp[0] += p3[dp[3]]
            dp[2] += temp3
            dp[1] += temp2
            dp[0] += temp1
            dp[3] += 1
            for j in range(3):
                dp[j] %= mod
            #print(dp)
    print(dp[2])

if __name__=="__main__":
    s = getval()
    main(s)
Problem p03327 (python)

Fixed submission:
n = int(input())
if n<1000:
    print("ABC")
else:
    print("ABD")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
dif = b-a 
temp = 0
for i in range(dif):
    temp += i 
ans = temp - a
print(ans)
Problem p03806 (python)

Fixed submission:
from copy import deepcopy

def getval():
    n,ma,mb = map(int,input().split())
    p = [list(map(int,input().split())) for i in range(n)]
    return n,ma,mb,p 

def main(n,ma,mb,p):
    dp = [[[-1 for i in range(401)] for i in range(401)]]
    dp[0][0][0] = 0
    for i in range(n):
        temp = deepcopy(dp[-1])
        temp[0][0] = 0
        cur = p[i]
        prev = dp[-1]
        for a in range(401):
            for b in range(401):
                if cur[0]>a or cur[1]>b:
                    continue
                if prev[a-cur[0]][b-cur[1]]==-1:
                    continue
                elif prev[a][b]==-1:
                    temp[a][b] = prev[a-cur[0]][b-cur[1]] + cur[2]
                    #print(i,a,b,temp[a][b],prev[a-cur[0]][b-cur[1]])
                else:
                    temp[a][b] = min(prev[a][b], prev[a-cur[0]][b-cur[1]] + cur[2])
        dp.append(temp)
    ans = -1
    for i in range(1,401):
        if i*ma>400 or i*mb>400:
            break
        if dp[n][i*ma][i*mb]!=-1:
            if ans==-1:
                ans = dp[n][i*ma][i*mb]
            else:
                ans = min(ans,dp[n][i*ma][i*mb])
    print(ans)
    #print(dp[n])

if __name__=="__main__":
    n,ma,mb,p = getval()
    main(n,ma,mb,p)

Buggy submission (verdict: Runtime Error):
from copy import deepcopy

def getval():
    n,ma,mb = map(int,input().split())
    p = [list(map(int,input().split())) for i in range(n)]
    return n,ma,mb,p 

def main(n,ma,mb,p):
    dp = [[[-1 for i in range(401)] for i in range(401)]]
    dp[0][0][0] = 0
    for i in range(n):
        temp = deepcopy(dp[-1])
        temp[0][0] = 0
        cur = p[i]
        prev = dp[-1]
        for a in range(401):
            for b in range(401):
                if cur[0]>a or cur[1]>b:
                    continue
                if prev[a-cur[0]][b-cur[1]]==-1:
                    continue
                elif prev[a][b]==-1:
                    temp[a][b] = prev[a-cur[0]][b-cur[1]] + cur[2]
                    #print(i,a,b,temp[a][b],prev[a-cur[0]][b-cur[1]])
                else:
                    temp[a][b] = min(prev[a][b], prev[a-cur[0]][b-cur[1]] + cur[2])
        #dp.append(temp)
    ans = -1
    for i in range(1,11):
        if i*ma>10 or i*mb>10:
            break
        if dp[n][i*ma][i*mb]!=-1:
            if ans==-1:
                ans = dp[n][i*ma][i*mb]
            else:
                ans = min(ans,dp[n][i*ma][i*mb])
    print(ans)
    print(dp[n])

if __name__=="__main__":
    n,ma,mb,p = getval()
    main(n,ma,mb,p)
Problem p02572 (python)

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

suma = sum(a)**2
sums = 0
for i in range(n):
    sums += a[i]*a[i]

ans = (suma - sums) // 2
ans %= 1000000007

print(int(ans))

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
#include <numeric>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x) x.begin(), x.end()
#define mod 1000000007

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
#include <numeric>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x) x.begin(), x.end()
#define mod 1000000007

int main()
{
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n)
    {
        cin >> a[i];
    }

    ll ans = 0;
    ll sum = 0;
    ll sums = 0;

    ans = 0;

    for (int i = 0; i < n; i++)
    {
        sums += a[i];
    }

    ans += (sums%mod) * (sums%mod);

    for (int i = 0; i < n; i++)
    {
        ans -= (a[i] * a[i]) % mod;
    }

    if(ans < 0) {
        ans += mod;
    }
    ans %= mod;

    ans *= (1.0/2);
    ans %= mod;

    cout << ans  << endl;
}

/*
int main()
{
    int n;cin >> n;
    vector<ll> a(n);
    vector<ll> b(n-1);
    rep(i,n) {
        cin >> a[i];
    }

    ll ans = 0;
    ll sum = 0;
    for (int i = 1; i < n; i++)
    {
        sum += a[i];  
    }


    int i = 1;
    for(int j = 0; j < n - 1; j++) {
        b[j] = sum;
        sum -= a[i++];
    }

    for(int i = 0; i < n - 1; i++) {
        ans += (b[i]%mod)*(a[i]%mod);
        ans %= mod;
    }



    cout << ans << endl;

}
*/

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
#include <numeric>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x) x.begin(), x.end()
#define mod 1000000007

int main()
{
    int n;cin >> n;
    vector<ll> a(n);
    vector<ll> b(n-1);
    rep(i,n) {
        cin >> a[i];
    }

    ll ans = 0;
    ll sum = 0;
    ll sums = 0;
    for (int i = 1; i < n; i++)
    {
        sum += a[i];  
    }


    int i = 1;
    for(int j = 0; j < n - 1; j++) {
        b[j] = sum;
        sum -= a[i++];
    }

    for(int i = 0; i < n - 1; i++) {
        ans += b[i]*a[i];
        ans %= mod;
    }



    cout << ans << endl;

}
Problem p02759 (python)

Fixed submission:
a = int(input())
if(a%2 == 1):
  print((a+1)//2)
if(a%2 == 0):
  print(a//2)

Buggy submission (verdict: Runtime Error):
a = input()
if(a%2 == 1):
  print((a+1)//2)
if(a%2 == 0):
  print(a//2)
Problem p02598 (python)

Fixed submission:
import math
N,K = map(int,input().split())
a = list(map(int,input().split()))
def is_ok(arg):
    i = 0
    for item in a:
        i += math.ceil(item /arg) -1
    return i <=K

def meguru_bisect(ng, ok):
    '''
    初期値のng,okを受け取り,is_okを満たす最小(最大)のokを返す
    まずis_okを定義すべし
    ng ok は  とり得る最小の値-1 とり得る最大の値+1
    最大最小が逆の場合はよしなにひっくり返す
    '''
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok


print(meguru_bisect(0,10**9))

Buggy submission (verdict: Runtime Error):
import math
N,K = map(int,input().split())
a = list(map(int,input().split()))
low = 0
high = 10**9
while low  <= high:
    mid = (low+high)//2
    count = 0
    for item in a:
        count += math.ceil(item/mid)-1
    if count <= K:
        high = mid -1
    else:
        low = mid + 1
print(low)

Buggy submission (verdict: Runtime Error):
import math
N,K = map(int,input().split())
a = list(map(int,input().split()))
low = 0
high = 10**9
while low  <= high:
    mid = (low+high)//2
    count = 0
    for item in a:
        count += math.ceil(a/mid)-1
    if count <= K:
        high = mid -1
    else:
        low = mid + 1
print(low)
Problem p02659 (python)

Fixed submission:
A, B = map(float, input().split())
A = int(A)
B = int(B*1000)
print((A*B)//1000)

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

Fixed submission:
N1 = int(input())
print(N1 ** 3)

Buggy submission (verdict: Runtime Error):
N = input()
print(N * N * N)

Buggy submission (verdict: Runtime Error):

def fs(Q,n):
    l = len(Q) - 1
    res = 0
    for i in range(n + 2):
        res += Q[l - i]
        if res == 2:
            return l - i + 1
def main():
    N = int(input())
    B = list(map(int,input().split()))
    Q = [1] * N
    s = N - 1
    res = N - 1
    for i in range(N - 2):
        Q[i] = 0
        s = fs(Q,i)
        res += s
    s = N - 1
    for i in range(N - 3 ,0,-1):
        Q[i] = 0
        s = fs(Q,i)
        res += s
    print(res)

        
        

if __name__ == "__main__":
    
    main()
Problem p02954 (python)

Fixed submission:
s = input()
# s = 'RRRLLL'
n = len(s)
index = []

a = 'R'
for i in range(n):
    if a == 'R' and s[i] == 'L':
        index += [(i - 1)]
        a = 'L'
    elif a == 'L' and s[i] == 'R':
        index += [-(i - 1)]
        a = 'R'
m = len(index)

ans = [0] * n
j = 0
r = 0
while True:
    if j == m - 1:
        l = n
        if (index[j] - r) % 2 == 1:
            ans[index[j]] = (l - r) // 2
            ans[index[j]+1] = (l - r) - (l - r) // 2 
        else:
            ans[index[j]+1] = (l - r) // 2
            ans[index[j]] = (l - r) - (l - r) // 2
        break 
    l = -index[j+1] + 1
    if (index[j] - r) % 2 == 1:
        ans[index[j]] = (l - r) // 2
        ans[index[j]+1] = (l - r) - (l - r) // 2 
    else:
        ans[index[j]+1] = (l - r) // 2
        ans[index[j]] = (l - r) - (l - r) // 2
    r = l
    j += 2

ans = map(str, ans)
print(' '.join(ans))

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

n = len(s)
index = []

a = 'R'
for i in range(n):
    if a == 'R' and s[i] == 'L':
        index += [(i - 1)]
        a = 'L'
    elif a == 'L' and s[i] == 'R':
        index += [-(i - 1)]
        a = 'R'


ans = [0] * n
i = 0
j = 0
while i < n:
    if abs(i - index[j]) % 2 == 0:
        ans[index[j]] += 1
    else:
        ans[index[j]+1] += 1

    if -i in index:
        j += 2
    i += 1
ans = map(str, ans)
print(' '.join(ans))
Problem p03013 (python)

Fixed submission:
def culc(m):
    a1=0
    a2=1
    for i in range(m):
        a2_=a2
        a2=a1+a2
        a1=a2_
    return a2

N,M=map(int,input().split())
a=[-1]
b=[]
for i in range(M):
    a+=[int(input())]
    b+=[a[-1]-a[-2]-2]
    if a[-1]-a[-2]==1:
        b=[]
        break
else:
    b+=[N-a[-1]-1]
if b==[]:
    sm=0
else:
    sm=culc(b[0])
for i in b[1:]:
    sm=sm*culc(i)
print(sm%1000000007)

Buggy submission (verdict: Runtime Error):
def culc(m):
    s=0
    if m%2==1:
        m1=1 #1の個数
        m2=m//2 #2の個数
    else:
        m1=0
        m2=m//2
    
    while m2>=0:
        l1=1
        l2=1
        for i in range(m2):
            l1=l1*(m1+i+1)
            l2=l2*(i+1)
        s+=int(l1/l2)
        m1+=2
        m2+=-1
    return s

N,M=map(int,input().split())
a1=-1
b=[]
for i in range(M):

    a2=int(input())
    da=a2-a1
    a1=a2
    if da==1:
        b=[]
        break
    elif da!=0:
        b+=[da-2]

else:
    b+=[N-a2-1]


if b==[]:
    sm=0
else:
    b.sort()
    c=culc(b[0])
    sm=c
    s1=b[0]
    for i in b[1:]:
        if s1==i:
            sm=sm*c
        else:
            c=culc(i)
            sm=sm*c
print(sm%1000000007)
Problem p03038 (python)

Fixed submission:
n,m=map(int,input().split())
a=[i for i in map(int,input().split())]
a.sort()
b=[]
for _ in range(m):
    b1=[i for i in map(int,input().split())]
    b1.reverse()
    b+=[b1]
b.sort(reverse=True)

i=0
f=0
s=0
lenb=len(b)
lena=len(a)
while f==0:
    if i>lenb-1 or s>lena-1:
        break
    elif s+b[i][1]>lena-1:
        b[i][1]=lena-s
    if a[s+b[i][1]-1]<b[i][0]:
        a[s:s+b[i][1]]=[b[i][0]]*(b[i][1])
        s+=b[i][1]
    elif a[s]<b[i][0]:
        j=0
        while a[s+j]<b[i][0]:
            a[s+j]=b[i][0]
            j+=1
            if s+j>lena-1:
                break
        break
    else:
        break
    i+=1

print(sum(a))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[i for i in map(int,input().split())]
a.sort()
b=[]
for _ in range(m):
    b1=[i for i in map(int,input().split())]
    b1.reverse()
    b+=[b1]
b.sort(reverse=True)

i=0
f=0
s=0
while f==0:
    if a[s+b[i][1]-1]<b[i][0]:
        a[s:s+b[i][1]]=[b[i][0]]*(b[i][1])
        s+=b[i][1]
    elif a[s]<b[i][0]:
        j=0
        while a[s+j]<b[i][0]:
            a[s+j]=b[i][0]
            j+=1
        f+=1
    else:
        f+=1
    i+=1
    if i>len(b)-1:
        f+=1

print(sum(a))
Problem p03127 (python)

Fixed submission:
N = int(input())
A = [int(_) for _ in input().split()]
m = min(A)
while m > 0:
    for i in range(0,len(A)):
        if A[i] != m:
            A[i] = A[i]%m
    z = A.count(0)
    A = sorted(A)[z:]
    m = A[0]
    if m == 1:
        break
    else:
        if [_%m for _ in A] == [0]*len(A):
            break
print(m)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int for i in input().split()]
mini=min(A)
while mini>0:
    for i in range(len(A)):
        if A[i]!=mini:
            A[i]=A[i]%mini
    z=A.count(0)
    A=sorted(A)[z:]
    m=A[0]
    if m==1:
        break
    else:
        if [i%m for i in A]==[0]*len(A):
            break
print(A[0])
Problem p03805 (python)

Fixed submission:
import itertools
n,m=map(int,input().split())
lst=[]
for i in range(m):
    lst+=[list(map(int,input().split()))]



pair=[[0]*n for i in range(n)]
for i,j in lst:
    pair[i-1][j-1]=1
    pair[j-1][i-1]=1


def keiro(a):
    count=0
    for i in range(n-1):
        if pair[a[i]-1][a[i+1]-1]==0:
            break
    else:
        count+=1
    return count
cn=0
b=[i for i in range(2,n+1)]
for i in list(itertools.permutations(b)):
    a=[1]+list(i)
    if keiro(a)==1:
        cn+=1

print(cn)

Buggy submission (verdict: Runtime Error):
import itertools
n,m=map(int,input().split())
lst=[]
for i in range(m):
    lst+=[list(map(int,input().split()))]



pair=[[0]*n for i in range(n)]
for i,j in lst:
    pair[i-1][j-1]=1
    pair[j-1][i-1]=1


def keiro(a):
    count=0
    for i in range(n-1):
        if pair[a[i]-1][a[i+1]-1]==0:
            break
    else:
        count+=1
    return count
cn=0
b=[i for i in range(2,m+1)]
for i in list(itertools.permutations(b)):

    a=[1]+list(i)

    if keiro(a)==1:
        cn+=1

print(cn)
Problem p02771 (python)

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

if a == b and a != c:
    print("Yes")
elif a == c and a != b:
    print("Yes")
elif b == c and b != a:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())
s = [input() for i in range(n)]

c = collections.Counter(s).most_common()
ans = [k for k, v in c if c[0][1] == v]
ans.sort()

for i in ans:
    print(i)
Problem p02557 (python)

Fixed submission:
import sys
import heapq
from functools import lru_cache


# \n
def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    n = N // 3

    @lru_cache(maxsize=None)
    def diff(s):
        count = 0
        for i in range(N):
            if A[i] == B[(i + s) % N]:
                count += 1

        if count == 0:
            print("Yes")
            L = []
            for i in range(N):
                L.append(B[(i + s) %N])
            print(*L)
            exit()

        return count

    l = 0
    r = N - 1
    diff(l)
    diff(r)

    while r - l > 2:
        a = diff(l + (r - l) // 3)
        b = diff(l + 2 * (r - l) // 3)
        if a > b:
            l = l + (r - l) // 3
        else:
            r =l + 2 * (r - l) // 3
    diff((l+r)//2)

    print("No")


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
from collections import Counter
import bisect


# \n
def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    AA = Counter(A)
    BB = Counter(B)

    max_con = 1
    conA = 0

    for key, value in AA.items():
        if not BB[key]:
            continue

        if BB[key] + value > max_con:
            max_con =BB[key] + value
            conkey = key

        if BB[key] + value > N:
            print("No")
            exit()

    print("Yes")

    A_key = bisect.bisect_right(A, conkey)
    B_key = bisect.bisect_left(B, conkey)


    S=[0]*N

    for i in range(N):
        S[(i+A_key)%N] =B[(B_key+i)%N]

    print(*S)


if __name__ == "__main__":
    main()
Problem p02627 (python)

Fixed submission:

n = input()
a =ord(n)
if a>96:
    print("a")
else:
    print("A")

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    n = input()
    a =ord(n)
    if a>96:
        print("a")
    else:
        print("A")

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**5)

def main():
    n = input()
    a =ord(n)
    if a>96:
        print("a")
    else:
        print("A")

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

n = input()
a =ord(n)
if a>96:
    print("a")
else:
    print("A")

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**5)

def main():
    n = input()
    a =ord(n)
    if a>96:
        print("a")
    else:
        print("A")





if __name__ == "__main__":
    main()
Problem p02699 (python)

Fixed submission:
s , w = map(int, input().split())

if w>=s:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
import itertools
s = input()
count = 0

for i,j in itertools.combinations(range(0,len(str(s))+1),2):
    if int(s[i:j]) % 2019 ==0:
        count +=1
    print(s[i:j])
print(count)
Problem p02711 (python)

Fixed submission:
n = list(input())
if "7" in n:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import itertools


input()
s = list(input())
r =[]
g =[]
b =[]
n= len(s)
ans =0
for i in range(n):
    if s[i]== "R":
        r.append(i+1)
    elif s[i]== "G":
        g.append(i+1)
    else:
        b.append(i+1)

for ri , gi in itertools.product(r,g):
    rg=gi-a
    if rg+gi in b:
        ans -=1
    if  ri-rg in b:
        ans -=1
    if (gi+ri)/2 in b:
        ans -=1

ans += len(r)*len(b)*len(g)
print(ans)
Problem p02754 (python)

Fixed submission:
N , A, B, =map(int,input().split())
d, m =divmod(N, A+B)
print(d*A + min(m,A))

Buggy submission (verdict: Runtime Error):
N , A, B, =map(int,input().split())
d, m =divmod(N, A+B)
print(d*A + min(m,A))
Problem p02792 (python)

Fixed submission:
import math
import numpy as np
N = int(input())
tb = [[0]*10]*10
tb = np.array(tb)
for i in range(1,N+1):
    s = str(i)
    tb[int(s[0])][int(s[-1])] =tb[int(s[0])][int(s[-1])] +1
 
point =0
 
for i in range(0,10):
    for j in range(0,10):
        point += tb[i][j] * tb[j][i]
 
print(point)

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
N = int(input())
tb = [[0]*10]*10
tb = np.array(tb)
for i in range(1,N+1):
    s = str(i)
    tb[int(s[0])][int(s[-1])] =tb[int(s[0])][int(s[-1])] +1
 
point =0
 
for i in range(0,10):
    for j in range(0,10):
        point += tb[i][j] * tb[j][i]
Problem p02881 (python)

Fixed submission:
N = int(input())
root = int(N**0.5)
for i in range(root,-1,-1):
  if N % i ==0:
    break

print(int(N/i + i -2))

Buggy submission (verdict: Runtime Error):
N = int(input())
root = int(N**0.5)
for i in range(root,1,-1):
  if N % i ==0:
    break

print(N/i + i -2)
Problem p02596 (python)

Fixed submission:
K = int(input())
if K%7 == 0:
  L = 9*K//7
else:
  L = 9*K

if K%2 == 0 or K%5 == 0:
  print(-1)
else:
  X = 10%L
  if X == 1:
    print(1)
  else:
    for i in range(K):
      X = X*10 % L
      if X == 1:
        print(i+2)
        break

Buggy submission (verdict: Runtime Error):
K = int(input())
ans1 = -1
for i in range(K):
  ans = 7/9*(10**(i+1)-1)
  if ans%K == 0:
    ans1 = i+1
    break
print(ans1)
Problem p02659 (python)

Fixed submission:
import math
a,b = map(str, input().split())
b = b.replace(".","")
a = int(a)
b = int(b)
print(a * b // 100)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(float,input().split())
A = int(a)
print(math.floor(A*B))

Buggy submission (verdict: Runtime Error):
import math
a,b = input().split()
A=int(input())
B=float(input())
print(math.floor(A*B))

Buggy submission (verdict: Runtime Error):
import math

A,B = map(float, input().split())
print(math.floor(A*B))
Problem p02676 (python)

Fixed submission:
K = int(input())
S = input()
if len(S) <= K:
 print(S)
else:
 print(S[:K] + '...')

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) =< K:
 print(S)
else:
 print(S[:K+1] + '...')

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) =< K:
 print(S)
else:
 print(S[:K+1]+'...')

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) =< int(K):
 print(S)
else:
 print(S[:int(K)]+'...')

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) =< int(K):
 print(S)
else:
 print(S[0:K]+'...')

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) =< K:
 print(S)
else:
 print(S[:K+1]+'...')

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) =< int(K):
 print(S)
else:
 print(S[:int(K)+1]+'...')

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

if len(S) =< K:
 print(S)
else:
 print(S[1:K+1]+'...')

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

if len(S) =< int(K):
 print(S)
else:
 print(S[1:K+1])

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

if len(S) =< K:
 print(S)
else:
 print(S[1:K+1])
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=input() W=input()
print("unsafe" if int(W) >= int(S) else "safe")

Buggy submission (verdict: Runtime Error):
S = input() W = input()
if(int(W)>=int(S)):
  print('unsafe')
else:
  print('safe')
Problem p02773 (python)

Fixed submission:
N = int(input())
d = {}
for _ in range(N):
  S = input()
  if S in d:
    d[S] += 1
  else:
    d[S] = 1
m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
  print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = {}
for _ in range(N):
  S = input()
  if S in d:
    d[S] += 1
  else:
   　d[S] = 1
m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
  print(s)