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

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

li = [0]*n

for i in range(m):
    s, c = map(int, input().split())
    if li[s-1] != 0 and li[s-1] != c:
        print(-1)
        exit(0)
    if s==1 and c==0:
        if n>1:
            print(-1)
            exit(0)
    li[s-1]=c

if n>1 and li[0]==0:
    li[0]=1

for i in range(n):
    print(li[i], end="")

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

li = [0]*n

for i in range(n):
    s, c = map(int, input().split())
    if li[s-1] != 0 and li[s-1] != c:
        print(-1)
        exit(0)
    if s==1 and c==0:
        print(-1)
        exit(0)
    li[s-1]=c

if li[0]==0:
    li[0]=1

for i in range(n):
    print(li[i], end="")
Problem p02780 (python)

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

num_li = [0]*n

for i in range(n):
    num_li[i] = (p[i]+1)/2

num = sum(num_li[:k])
ans = num

for j in range(n-k):
    num = num-num_li[j]+num_li[j+k]
    ans = max(num, ans)

print(ans)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
n, k = map(int, input().split())
p = list(map(int, input().split()))

num_li = [0]*n
ans = 0
num = 0

for i in range(n):
    num_li[i] = ((p[i]*(p[i]+1))/2)/Decimal(p[i])

num = sum(num_li[:k])

for j in range(n-k):
    num = num-num_li[j]+num_li[j+k]
    ans = max(num,ans)

print('{:.10f}'.format(ans))
Problem p02898 (python)

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

h = list(map(int, input().split()))

ans=0

for i in range(n):
    if h[i]>=k:
        ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n

for i in range(n):
    ans[a[i]-1]=i+1

print(" ".join(map(str,ans)))
Problem p02983 (python)

Fixed submission:
l, r = map(int, input().split())

if r-l>2019:
    print(0)
    exit(0)
else:
    a = list(range(l, r+1))

num = 0
ans = 2019

for i in range(len(a)):
    for j in range(len(a)):
        if a[i]<a[j]:
            num = (a[i]*a[j])%2019
            ans = min(ans, num)
            if ans == 0:
                print(0)
                exit(0)

print(ans)

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())

a = list(range(l, r+1))

if len(a)>2019:
    a = a[:2019]

num = 0
ans = 2019

for i in range(len(a)):
    for j in range(len(a)):
        if a[i]<a[j]:
            num = (a[i]*a[j])%2019
            ans = min(ans, num)
            if ans == 0:
                print(0)
                exit(0)

print(ans)

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())

a = list(range(l, r+1))

if len(a)>2019:
    a = a[:2019]

print(a)

num = 0
ans = 2019

for i in range(len(a)):
    for j in range(len(a)):
        if a[i]<a[j]:
            num = (a[i]*a[j])%2019
            ans = min(ans, num)
            if ans == 0:
                print(0)
                exit(0)

print(ans)

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())

a = list(range(l, r+1))
a_len = len(a)
if a_len>2019:
    a = a[:2019]

num = 0
ans = 2019

for i in range(a_len):
    for j in range(a_len):
        if a[i]<a[j]:
            num = (a[i]*a[j])%2019
            ans = min(ans, num)
            if ans == 0:
                print(0)
                exit(0)

print(ans)
Problem p03076 (python)

Fixed submission:
l = []
num = []

for i in range(5):
    menu = int(input())
    if menu%10 != 0:
        num.append(menu%10)
        menu = (menu//10+1)*10
    l.append(menu)

ans = sum(l)

if num:
    ans -= 10-min(num)

print(ans)

Buggy submission (verdict: Runtime Error):
l = []
num = []

for i in range(5):
    menu = int(input())
    if menu%10 != 0:
        num.append(menu%10)
        menu = (menu//10+1)*10
    l.append(menu)

ans = sum(l)-(10-min(num))

print(ans)
Problem p03836 (python)

Fixed submission:
sx, sy, tx, ty= map(int, input().split())

w = tx-sx
h = ty-sy


ans = ""
ans+="R"*w
ans+="U"*h
ans+="L"*w
ans+="D"*h

ans+="D"
ans+="R"*(w+1)
ans+="U"*(h+1)
ans+="L"

ans+="U"
ans+="L"*(w+1)
ans+="D"*(h+1)
ans+="R"

print(ans)

Buggy submission (verdict: Runtime Error):
sx, sy, tx, ty= map(int, input().split())

w = tx-sx
h = ty-sy


ans = ""
ans+="R"*w
ans+="U"*h
ans+="L"*w
ans+="D"*h

ans+="D"
ans+="R"*(x+1)
ans+="U"*(y+1)
ans+="L"

ans+="U"
ans+="L"*(x+1)
ans+="D"*(y+1)
ans+="R"

print(ans)
Problem p02642 (python)

Fixed submission:
from collections import defaultdict

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

DP = [0] * (10 ** 6 + 1)

A.sort()
Sum = 0

d = defaultdict(int)
for key in A:
    d[key] += 1

for i in range(N):

    if DP[A[i]] == 0:
        for j in range(1, 10 ** 6):
            if A[i] * j <= 10 ** 6:
                DP[A[i] * j] = 1
            else:
                break

        if d[A[i]] == 1:
            Sum += 1
print(Sum)

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

DP = [0] * (10 ** 6 + 1)

A.sort()
Sum = 0

for i in range(N):

    if DP[A[i]] == 0:
        for j in range(1, 10 ** 6):
            if A[i] * j <= 10 ** 6:
                DP[A[i] * j] = 1
            else:
                break

        if i == 0:
            if A[i] != A[i + 1]:
                Sum += 1
        elif i < N - 1:
            if A[i] != A[i + 1] and A[i] != A[i - 1]:
                Sum += 1
        
print(Sum)

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

DP = [0] * (10 ** 6 + 1)

A.sort()
Sum = 0

for i in range(N):

    if DP[A[i]] == 0:
        for j in range(1, 10 ** 6):
            if A[i] * j <= 10 ** 6:
                DP[A[i] * j] = 1
            else:
                break

        if i == 0:
            if A[i] != A[i + 1]:
                Sum += 1
        elif i < N - 1:
            if A[i] != A[i + 1] and A[i] != A[i - 1]:
                Sum += 1
        else:
            if A[i] != A[i - 1]:
                Sum += 1
print(Sum)

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

DP = [0] * (10 ** 6 + 1)

A.sort()
Sum = 0

for i in range(N):

    if DP[A[i]] == 0:
        for j in range(1, 10 ** 6):
            if A[i] * j <= 10 ** 6:
                DP[A[i] * j] = 1
            else:
                break

        if i == 0:
            if A[i] != A[i + 1]:
                Sum += 1



print(Sum)

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

DP = [0] * (10 ** 6 + 1)

A.sort()
Sum = 0

for i in range(N):

    if DP[A[i]] == 0:
        for j in range(1, 10 ** 6):
            if A[i] * j <= 10 ** 6:
                DP[A[i] * j] = 1
            else:
                break

        if i == 0:
            if A[i] != A[i + 1]:
                Sum += 1
        elif i == N - 1:
            if A[i] != A[i - 1]:
                Sum += 1


print(Sum)

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

DP = [0] * (10 ** 6 + 1)

A.sort()
Sum = 0

for i in range(N):

    if DP[A[i]] == 0:
        for j in range(1, 10 ** 6):
            if A[i] * j <= 10 ** 6:
                DP[A[i] * j] = 1
            else:
                break

        if i == 0:
            if A[i] != A[i + 1]:
                Sum += 1
        elif i == N - 1:
            if A[i] != A[i - 1]:
                Sum += 1
        else:
            if A[i] != A[i + 1] and A[i] != A[i - 1]:
                Sum += 1

print(Sum)
Problem p02696 (python)

Fixed submission:
A,B,N = map(int, input().split())
print(A*min(N,B-1)//B)

Buggy submission (verdict: Runtime Error):
print(hoge)
Problem p02732 (python)

Fixed submission:
from collections import defaultdict

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

d = defaultdict(int)
for key in A:
    d[key] += 1
    #print(d)

Sum = 0
for i in d:
    n = d[i]
    Sum += (n * (n - 1)) // 2
    #print((n * (n - 1)) // 2)
    #print(d[A[i]],i)
    #print(d)

#print(Sum)

for i in range(N):
    n = d[A[i]]
    hoge = Sum - (n*(n-1))//2
    n -= 1
    hoge += (n*(n-1))//2
    print(hoge)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

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

d = defaultdict(int)
for key in A:
    d[key] += 1
    #print(d)

Sum = 0
for i in d:
    n = d[A[i]]
    Sum += (n * (n - 1)) // 2
    #print((n * (n - 1)) // 2)
    #print(d[A[i]],i)
    #print(d)

#print(Sum)

for i in range(N):
    n = d[A[i]]
    hoge = Sum - (n*(n-1))//2
    n -= 1
    hoge += (n*(n-1))//2
    print(hoge)
Problem p02761 (python)

Fixed submission:
import sys

N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
    s[i], c[i] = map(int, input().split())


for i in range(1000):
    S = str(i)

    if len(S) != N:
        continue

    for j in range(M):
        if int(S[s[j]-1]) != c[j]:
            break
        if j == M-1:
            print(S)
            sys.exit()

    if M == 0:
        print(S)
        sys.exit()

print("-1")

Buggy submission (verdict: Runtime Error):
import sys

N, M = map(int, input().split())
a = [0] * M
b = [0] * M
for i in range(M):
    a[i], b[i] = map(int, input().split())

for i in range(10**N):
    for j in range(M):
        Number = str(i)

        

        if str(Number[a[j] - 1]) != str(b[j]) or len(str(i)) != N:
            break

        if j == M - 1:
            print(i)
            sys.exit()
            
print(-1)
Problem p02765 (python)

Fixed submission:
N,R = map(int, input().split())

if N >= 10:
    print(R)
else:
    print(R + (100*(10-N)))

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

if N >= 10:
    print(R)
else:
    print(R + (100*(10-K)))
Problem p02804 (python)

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


def Com_kai(n, r, mod):
    if (r < 0 or r > n or n < 0):
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


mod = 10 ** 9 + 7  # 出力の制限
N = 10 ** 6
g1 = [1, 1]  # 元テーブル
g2 = [1, 1]  # 逆元テーブル
inverse = [0, 1]  # 逆元テーブル計算用テーブル

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)

A.sort()

Max_Sum = 0
Min_Sum = 0
Mod = 1000000007

for i in range(n):
    Min_Sum = (Min_Sum + (A[i] * Com_kai(n - (i + 1), K - 1, Mod)) % Mod) % Mod
    Max_Sum = (Max_Sum + (A[i] * Com_kai(i, K - 1, Mod)) % Mod) % Mod


print((Max_Sum - Min_Sum + Mod) % Mod)

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


def Com_kai(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


mod = 10 ** 9 + 7  # 出力の制限
N = 10 ** 6
g1 = [1, 1]  # 元テーブル
g2 = [1, 1]  # 逆元テーブル
inverse = [0, 1]  # 逆元テーブル計算用テーブル

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)


A.sort()

Max_Sum = 0
Min_Sum = 0
Mod = 1000000007

for i in range(N):
    Min_Sum = (Min_Sum + (A[i] * Com_kai(N - (i + 1), K - 1, Mod)) % Mod) % Mod
    Max_Sum = (Max_Sum + (A[i] * Com_kai(i, K - 1, Mod)) % Mod) % Mod

print((Max_Sum - Min_Sum + Mod) % Mod)

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


def Kaijo():
    Max = 510000
    Mod = 1000000007

    table = [0] * Max

    table[0] = 1
    table[1] = 1
    for i in range(2, Max):
        table[i] = table[i - 1] * i % Mod

    return table


def Com_kai(n, r, table):
    Mod = 1000000007

    if n < 0 or r < 0:
        return 0
    else:
        return (table[n] // ((table[n - r] * table[r]) % Mod)) % Mod


Table = Kaijo()

A.sort()

Max_Sum = 0
Min_Sum = 0
Mod = 1000000007

for i in range(N):
    Min_Sum = (Min_Sum + A[i] * Com_kai(N - (i + 1), K - 1, Table))%Mod
    Max_Sum = (Max_SumA[i] * Com_kai(i, K - 1, Table))%Mod

print((Max_Sum - Min_Sum +Mod)%Mod)
Problem p02838 (python)

Fixed submission:
import math

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

Sum = 0
mod = (10 ** 9) + 7

for i in range(len(bin(max(A)))-2):
    Sum_1 = 0
    for j in range(N):
        #print(i, j)
        if ((A[j] >> i) & 1):
            Sum_1 += 1

    Sum_0 = N - Sum_1

    Sum = (Sum + ((Sum_0 * Sum_1) % mod * (2 ** i)) % mod) % mod
    # print(Sum_0,Sum_1)

print(Sum)

Buggy submission (verdict: Runtime Error):
import math

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

Sum = 0
mod = (10 ** 9) + 7

for i in range(int(math.log2(max(A))) + 1):
    Sum_1 = 0
    for j in range(N):
        #print(i, j)
        if ((A[j] >> i) & 1):
            Sum_1 += 1

    Sum_0 = N - Sum_1

    Sum = (Sum + ((Sum_0 * Sum_1) % mod * (2 ** i)) % mod) % mod
    # print(Sum_0,Sum_1)

print(Sum)
Problem p02861 (python)

Fixed submission:
N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    x[i], y[i] = map(int, input().split())

import itertools
import numpy as np
import math

p = list(itertools.permutations(range(N)))

Sum_N = 0

for i in range(len(p)):

    Sum = 0

    for j in range(N - 1):
        Sum += math.sqrt((x[p[i][j]] - x[p[i][j + 1]]) ** 2 + (y[p[i][j]] - y[p[i][j + 1]]) ** 2)

    Sum_N += Sum

print(Sum_N / len(p))

Buggy submission (verdict: Runtime Error):
N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    x[i], y[i] = map(int, input().split())

import itertools
import numpy as np
import math

np.sqrt(x)

p = list(itertools.permutations(range(N)))

Sum_N = 0

for i in range(len(p)):

    Sum = 0

    for j in range(N - 1):
        Sum += np.sqrt((x[p[i][j]] - x[p[i][j + 1]]) ** 2 + (y[p[i][j]] - y[p[i][j + 1]]) ** 2)

    Sum_N += Sum

print(Sum_N / len(p))
Problem p02921 (python)

Fixed submission:
S = str(input())
T = str(input())

Sum = 0

for i in range(len(S)):
    if S[i] == T[i]:
        Sum += 1
        
print(Sum)

Buggy submission (verdict: Runtime Error):
S = str(input())
T = str(input())

Sum = 0

for i in range(S):
    if S[i] == T[i]:
        Sum += 1
        
print(Sum)
Problem p02993 (python)

Fixed submission:
S = int(input())

Flag = True

if (S//1000) == ((S%1000)//100) or ((S%1000)//100) == ((S%100)//10) or ((S%100)//10) == ((S%10)//1):
  Flag = False
  
if Flag == False:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
S = input().split()

Flag = True

if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  Flag = False
  
if Flag == False:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
S = input().sprit()

Flag = True

if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  Flag = False
  
if Flag == False:
  print("Bad")
else:
  print("Good")
Problem p03161 (python)

Fixed submission:
N, K = map(int, input().split())
h = list(map(int, input().split()))

dp = [1000000000] * N
dp[0] = 0

for i in range(N - 1):
    for j in range(1, K + 1):
        if i + j < N:
            if dp[i + j] > abs(h[i + j] - h[i]) + dp[i]:
                dp[i + j] = abs(h[i + j] - h[i]) + dp[i]
        else:
            break

print(dp[N - 1])

Buggy submission (verdict: Runtime Error):

dp = [1000000000] * N
Problem p03164 (python)

Fixed submission:
N, W = map(int, input().split())
w = [0] * N
v = [0] * N
sum_v = 0
for i in range(N):
    w[i], v[i] = map(int, input().split())
    sum_v += v[i]

DP = [0] * (sum_v+1)

for i in range(N):
    for j in (reversed(range(sum_v))):
        if j == 0 or DP[j] != 0:
            if DP[j + v[i]] > DP[j] + w[i] or DP[j + v[i]] == 0:
                DP[j + v[i]] = DP[j] + w[i]
                

for j in (reversed(range(sum_v+1))):
    if DP[j] != 0 and DP[j] <= W:
        print(j)
        break

Buggy submission (verdict: Runtime Error):
N, W = map(int, input().split())
w = [0] * N
v = [0] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())

dp_v = [0] * (W+1)

for i in range(N):
    for j in (reversed(range(W+1))):
        if (j == 0 or dp_v[j] != 0) and j+w[i] <= W and dp_v[j+w[i]] < dp_v[j] + v[i]:
            dp_v[j+w[i]] = dp_v[j] + v[i]
            
max = 0        
for i in range(W+1):
    if max < dp_v[i]:
        max = dp_v[i]

print(max)
Problem p03695 (python)

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

rank = [0]*9

for i in range(N):
    if a[i] < 400:
        rank[0] += 1
    elif a[i] < 800:
        rank[1] += 1
    elif a[i] < 1200:
        rank[2] += 1
    elif a[i] < 1600:
        rank[3] += 1
    elif a[i] < 2000:
        rank[4] += 1
    elif a[i] < 2400:
        rank[5] += 1
    elif a[i] < 2800:
        rank[6] += 1
    elif a[i] < 3200:
        rank[7] += 1
    else:
        rank[8] += 1

sum = 0

for i in range(8):
    if rank[i] > 0:
        sum += 1

min = sum
max = sum + rank[8]

if min == 0:
  min = 1

print(min,max)

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

rank = [0]*9

for i in range(N):😌
    if a[i] < 400:
        rank[0] += 1
    elif a[i] < 800:
        rank[1] += 1
    elif a[i] < 1200:
        rank[2] += 1
    elif a[i] < 1600:
        rank[3] += 1
    elif a[i] < 2000:
        rank[4] += 1
    elif a[i] < 2400:
        rank[5] += 1
    elif a[i] < 2800:
        rank[6] += 1
    elif a[i] < 3200:
        rank[7] += 1
    else:
        rank[8] += 1

sum = 0

for i in range(8):
    if rank[i] > 0:
        sum += 1

min = sum
max = sum + rank[8]

if min == 0:
  min = 1

print(min,max)
Problem p02613 (python)

Fixed submission:
n = int(input())
p= []
AC = 0
WA = 0
TLE = 0
RE = 0
 
for i in range(n):
  p.append(input())
  
for j in p :
  if j == "AC":
    AC += 1
  elif j == "WA":
    WA += 1
  elif j == "TLE":
    TLE += 1
  else:
    RE += 1


  
print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + str(TLE))
print("RE x " + str(RE))

Buggy submission (verdict: Runtime Error):
n = int(input())
p= []
AC = 0
WA = 0
TLE = 0
RE = 0

for i in range(n):
  p.append(input())
  
for j in p :
  if j == "AC":
    AC += 1
  elif j == "WA":
    WA += 1
  elif j == "TLE":
    TLE += 1
  else:
    RE += 1
  
print("AC x " + AC)
print("WA x " + WA)
print("TLE x " + TLE)
print("RE x " + RE)
Problem p02639 (python)

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

for i in range(5):
  if p[i] == 0:
    x = i + 1
    
print(x)

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

p = list(map(int,input().split()))
s = []

for i in range(101):
  if i not in p:
    s.append(i)

    
if s == [0]:
  print(0)

else:
  

  k = abs(x-s[0])
  del s[0]
  for j in range(100-n):
    if abs(x-s[j]) < k:
      k = abs(x-s[j])
    else:
      answer = s[j-1]
      break
  else:
    answer = s[100-n-1]
  print(answer)

Buggy submission (verdict: Runtime Error):
p = list(map(int,input().split()))

for i in range(5):
  if p[i] == 0:
    x = i
    
 print(x)
Problem p02641 (python)

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

gap = x
ans = 0

for y in range(0,102):
  if y not in p:
    if abs(x - y) < gap:
      gap = abs(x-y)
      ans = y
      
print(ans)

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

p = list(map(int,input().split()))
s = []

for i in range(101):
  if i not in p:
    s.append(i)

k = abs(x-s[0])
del s[0]
for j in range(100-n):
  if abs(x-s[j]) < k:
    k = abs(x-s[j])
  else:
    answer = s[j-1]
    break
else:
  answer = s[100-n-1]
print(answer)
Problem p02657 (python)

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

print(a * b)

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

print(a * B)
Problem p02675 (python)

Fixed submission:
n = input()

x = len(n)-1


if n[x] == "2" or n[x] == "4" or n[x] == "5" or n[x] == "7" or n[x] == "9":
  print("hon")
  
elif n[x] == "0" or n[x] =="1" or n[x] == "6" or n[x] == "8":
  print("pon")
else:
  print("bon")

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

if k >= x:
  print(s)

else:
  print(s + "...")
Problem p02705 (python)

Fixed submission:
import math 
r = int(input())

ans = 2 * r * math.pi
print(ans)

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

p = list(map(int,input().split()))

for x in range(1,n+1):
  print(p.count(x))
Problem p02706 (python)

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

if n >= sum(homework):
  print(n-sum(homework))

else:
  print(-1)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input()>split())
homework = list(map(int,input().split()))

if n >= sum(homework):
  print(n-sum(homework))

else:
  print(-1)
Problem p02718 (python)

Fixed submission:
n,m = map(int,input().split())
hyo = list(map(int,input().split()))
all_hyo = sum(hyo)

hyo.sort(reverse=True)

a = True

for x in range(m):
  if hyo[x] < all_hyo / 4 / m:
    a = False
    break

if a :
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
hyo = list(map(int,input().split()))
all_hyo = sum(hyo)

hyo.sort(reverse=True)

a = True

for x in range(m):
  if hyo[m] < all_hyo / 4 / m:
    a = False
    break

if a :
  print("Yes")
else:
  print("No")
Problem p02724 (python)

Fixed submission:
money = int(input())

gohyakuen = money // 500

goen = (money-(gohyakuen*500)) // 5

happy = 1000 * gohyakuen + 5 * goen

print(happy)

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

gohyakuen = money // 500

goen = (money-(gohyaken*500)) // 5

happy = 1000 * gohyakuen + 5 * goen

print(happy)
Problem p02761 (python)

Fixed submission:
#nは桁数　 (1,0)が含まれてる時と、(2,4),(2,7)みたいな入力の時はだめ
n,m = map(int,input().split())
s = [0]*m
c = [0]*m
d = dict()
ans = 0

for x in range(m):
    s[x],c[x] = map(int,input().split())
    if s[x] not in d:
        d[s[x]] = c[x]
    elif d[s[x]] != c[x]:
        ans = -1
        break

else:
    ans = ""
    for x in range(1,n+1):
        if x in d :
            if x != 1:
                ans += str(d[x])
            elif x == 1 and d[x] != 0:
                ans += str(d[x])
            elif n == 1 and d[x] == 0:
                ans += "0"
            else:
                ans = -1
                break
        else:
            if m != 0:
                if x == 1:
                    ans += str(1)
                else:
                    ans += str(0)
            else:
                if n == 1:
                    ans = str(0)
                else:
                    ans = "1" + ("0"*(n-1))

print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
p = [[int(i) for i in input().split()] for _ in range(m)]
p.sort()

np = list(map(tuple,p))
np = list(set(np))
np.sort()
d = len(np)

np = list(map(list,np))


a = True

if [1,0] in np:
  a = False
  
for x in range(d-1):
  if np[x][0] == np[x+1][0]:
    if np[x][1] != np[x+1][1]:
      a = False
      break
ans = 0
if a:
  if np[0][0] != 1:
    ans = 10 ** (n-1)
    for z in range(d):
      ans += 10 ** (n-np[z][0]) * np[z][1]
    print(ans)
  else:
    for r in range(d):
      ans += 10 ** (n-np[r][0]) * np[r][1]
    print(ans)
    
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
p = [[int(i) for i in input().split()] for _ in range(m)]
p.sort()

np = list(map(tuple,p))
np = list(set(np))
np.sort()
d = len(np)


a = True

if [1,0] in np:
  a = False
  
for x in range(d-1):
  if np[x][0] == np[x+1][0]:
    if np[x][1] != np[x+1][1]:
      a = False
      break
ans = 0
if a:
  if np[0][0] != 1:
    ans = 10 ** (n-1)
    for z in range(d):
      ans += 10 ** (n-np[z][0]) * np[z][1]
    print(ans)
  else:
    for r in range(d):
      ans += 10 ** (n-np[r][0]) * np[r][1]
    print(ans)
    
else:
  print(-1)
Problem p02791 (python)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 0
a = p[0]
for x in range(len(p)):
  if p[x] <= a:
    count += 1
    a = p[x]
  
print(count)

Buggy submission (verdict: Runtime Error):
n = int(Input())
p = list(map(int,input().split()))
count = 0
for x in range(n):
  if p[x] == min(p[:x+1]):
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
n = int(Input())
p = list(map(int,input().split()))
count = 0
for x in range(len(p)):
  if p[x] == min(p[:x+1]):
    count += 1

print(count)