buggy
stringlengths
1
618k
fixed
stringlengths
16
618k
buggy_submission_id
stringlengths
10
10
fixed_submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
lang
stringclasses
1 value
buggy_verdict
stringclasses
2 values
N, M = map(int, input().split()) a = [int(input()) for i in range(M)] dp = [0 for i in range(N + 1)] flag = [False for i in range(N + 1)] dp[0] = 1 if a[0] != 1: dp[1] = 1 for i in a: flag[i] = True for i in range(2,N+1): if flag[i - 1] != True: dp[i] = dp[i - 1] if flag[i - 2] != True: ...
N, M = map(int, input().split()) bs = [True for i in range(N+1)] for i in range(M): a = int(input()) bs[a] = False dp = [0 for i in range(N+1)] dp[0] = 1 if bs[1] != False: dp[1] = 1 for i in range(2,N+1): if bs[i-1] != False: dp[i] += dp[i - 1] if bs[i - 2] != False: dp[i] += dp[i - ...
s757015427
s806769832
p03013
python
Runtime Error
N, M = map(int, input().split()) idcard = [[int(j) for j in input().split()] for i in range(M)] ans = {} if M == 1: print(idcard[0][1] - idcard[0][0] + 1) exit() t = 0 for i in idcard: for j in range(i[0], i[1] + 1): if j in ans: ans[j] += 1 else: ans[j] = 1 t...
N, M = map(int, input().split()) idcard = [[int(j) for j in input().split()] for i in range(M)] L = 0 R = 10**10 for i in idcard: L = max(L, i[0]) R = min(R, i[1]) if R >= L: print(R - L + 1) else: print(0)
s548629791
s210429505
p03037
python
Time Limit Exceeded
R, G, B, N = map(int, input().split()) ans = 0 for r in range((N//R)+1): for g in range((N//G)+1): v = R * r + G * g if v > N: continue if (N - v) % B != 0: continue ans +=1 print(ans)
R, G, B, N = map(int, input().split()) ans = 0 for r in range((N//R)+1): for g in range((N//G)+1): v = R * r + G * g if v > N: break if (N - v) % B == 0: ans +=1 print(ans)
s243330929
s173474222
p03048
python
Time Limit Exceeded
R, G, B, N = map(int, input().split()) ans = 0 for r in range(N+1): for g in range(N+1): b =( N - R * r - G * g) / B if b >= 0 and b.is_integer(): ans += 1 print(ans)
R, G, B, N = map(int, input().split()) ans = 0 for r in range((N//R)+1): for g in range((N//G)+1): v = R * r + G * g if v > N: break if (N - v) % B == 0: ans +=1 print(ans)
s007385670
s173474222
p03048
python
Time Limit Exceeded
R, G, B, N = map(int, input().split()) ans = 0 for r in range(N+1): for g in range(N+1): b =( N - R * r - G * g) // B if R *r + G * g + B * b == N and b >= 0: ans += 1 print(ans)
R, G, B, N = map(int, input().split()) ans = 0 for r in range((N//R)+1): for g in range((N//G)+1): v = R * r + G * g if v > N: break if (N - v) % B == 0: ans +=1 print(ans)
s660722706
s173474222
p03048
python
Time Limit Exceeded
N, M = [int(n) for n in input().split()] X = sorted([int(n) for n in input().split()]) if N>=M: print(0) else: dx = [] for j in range(M-1): dx.append(X[j+1]-X[j]) ans = sorted(dx, reverse=True) print(sum(ans[N-1:]))
N, M = map(int, input().split()) X = list(map(int, input().split())) if N >= M: print(0) exit() X.sort() leng = [] for i in range(1, M): leng.append(X[i] - X[i-1]) ans = sorted(leng, reverse = True) print(sum(ans[N - 1:]))
s793892451
s075198347
p03137
python
Runtime Error
N, K = map(int, input().split()) h = [int(input()) for i in range(N)] h.sort() l = [0 for i in range(N - K + 1)] for i in range(N - K + 1): l[i] = h[i + 2] - h[i] print(min(l))
N, K = map(int, input().split()) h = [int(input()) for i in range(N)] h.sort() mini = 10**10 for i in range(N - K + 1): mini = min(mini, h[i+K-1] - h[i]) print(mini)
s354647744
s234698209
p03208
python
Runtime Error
def gcd(x1, x2): if x2 == 0: return x1 return gcd(x2, x1 % x2) N, X = map(int, input().split()) x = list(map(int, input().split())) if N == 1: print(abs(X-x[0])) x.sort() D = gcd(abs(X-x[0]), abs(X-x[1])) for i in range(2, N): D = gcd(D, abs(X - x[i])) print(D)
def gcd(x1, x2): if x2 == 0: return x1 return gcd(x2, x1 % x2) N, X = map(int, input().split()) x = list(map(int, input().split())) if N == 1: print(abs(X - x[0])) exit() x.sort() D = gcd(abs(X-x[0]), abs(X-x[1])) for i in range(2, N): D = gcd(D, abs(X - x[i])) print(D)
s197847045
s565818360
p03262
python
Runtime Error
def hantei(x): N = int(input()) if N >= 105: print(1) else: print(0)
N = int(input()) ans = 0 for i in range(N + 1): if i % 2 == 0: continue c = 0 for j in range(1, i + 1): if i % j == 0: c += 1 if c == 8: ans += 1 print(ans)
s399904988
s176233448
p03281
python
Runtime Error
N = int(input()) a = list(map(int, input().split())) a.sort() i = N - 1 c = 0 while i >= 0: i = N -1 while a[i] % 2 != 0: i -= 1 if i < 0: print(c) exit() max_ = a[i] // 2 a = list(map(lambda x: x * 3, a)) a[i] = max_ c += 1 a.sort()
N = int(input()) a = list(map(int, input().split())) c = 0 for i in range(N): while a[i] % 2 == 0: a[i] /= 2 c += 1 print(c)
s229863892
s013050565
p03325
python
Time Limit Exceeded
C = [list(map(int, input().split())) for i in range(3)] x = [0,0,0] y = [] for i in range(3): y.append(C[0][i] - x[0]) for i in range(3): x[i] = C[i][0] - y[0] for i in range(3): for j in range(3): if x[i] + y[j] != C[i][j]: print('No') exit(1) print('Yes')
C = [list(map(int, input().split())) for i in range(3)] x = [0,0,0] y = [0,0,0] for i in range(3): y[i] = C[0][i] - x[0] for i in range(3): x[i] = C[i][0] - y[0] flag = True for i in range(3): for j in range(3): if x[i] + y[j] != C[i][j]: flag = False print('Yes' if flag else 'No')
s752462096
s574038609
p03435
python
Runtime Error
N = int(input()) L = [2, 1] for i in range(2, N+1): L.append(L[i - 1] + L[i - 2]) print(L[i])
N = int(input()) L = [2, 1] for i in range(2, N+1): L.append(L[i - 1] + L[i - 2]) print(L[N])
s491448590
s099926779
p03544
python
Runtime Error
H, W = map(int, input().split()) S = [] for i in range(H): s = list(input()) for j in range(W): if s[j] == '.': s[j] = 0 S.append(s) dx = [0,1,1,1,0,-1,-1,-1] dy = [1,1,0,-1,-1,-1,0,1] for i in range(H): for j in range(W): for k in range(8): nx = j + dx[k] ...
H, W = map(int, input().split()) S = [] for i in range(H): s = list(input()) for j in range(W): if s[j] == '.': s[j] = 0 S.append(s) dx = [0,1,1,1,0,-1,-1,-1] dy = [1,1,0,-1,-1,-1,0,1] for i in range(H): for j in range(W): if S[i][j] == "#": continue for ...
s454154355
s312265583
p03574
python
Runtime Error
K, S = map(int, input().split()) ans = 0 for X in range(K + 1): for Y in range(K + 1): if X + Y > S: continue for Z in range(K + 1): if X + Y + Z == S: ans += 1 print(ans)
K, S = map(int, input().split()) ans = 0 for X in range(K+1): for Y in range(K+1): Z = S - X - Y if 0 <= Z and Z <= K: ans += 1 print(ans)
s280266136
s802180807
p03835
python
Time Limit Exceeded
K, S = map(int, input().split()) ans = 0 for X in range(K + 1): for Y in range(K + 1): for Z in range(K + 1): if X + Y + Z == S: ans += 1 print(ans)
K, S = map(int, input().split()) ans = 0 for X in range(K+1): for Y in range(K+1): Z = S - X - Y if 0 <= Z and Z <= K: ans += 1 print(ans)
s267419632
s802180807
p03835
python
Time Limit Exceeded
x=input() if x == 'hi': print('Yes') else if x == 'hihi': print('Yes') else if x == 'hihihi': print('Yes') else if x == 'hihihihi': print('Yes') else if x == 'hihihihihi': print('Yes') else: print('NO')
x=input() if x == 'hi': print('Yes') elif x == 'hihi': print('Yes') elif x == 'hihihi': print('Yes') elif x == 'hihihihi': print('Yes') elif x == 'hihihihihi': print('Yes') else: print('No')
s010822524
s805149962
p02747
python
Runtime Error
x=input() if x == 'hi' print('Yes') else if x == 'hihi' print('Yes') else if x == 'hihihi' print('Yes') else if x == 'hihihihi' print('Yes') else if x == 'hihihihihi' print('Yes') else print('NO')
x=input() if x == 'hi': print('Yes') elif x == 'hihi': print('Yes') elif x == 'hihihi': print('Yes') elif x == 'hihihihi': print('Yes') elif x == 'hihihihihi': print('Yes') else: print('No')
s806994764
s805149962
p02747
python
Runtime Error
x=input() x1=len(x) x2 = x1 / 2 if x1 %2 == 0 if "hi"*x2 == s: print("Yes") else print("No") else: print("No")
x=input() if x == 'hi': print('Yes') elif x == 'hihi': print('Yes') elif x == 'hihihi': print('Yes') elif x == 'hihihihi': print('Yes') elif x == 'hihihihihi': print('Yes') else: print('No')
s732185798
s805149962
p02747
python
Runtime Error
x=input() x1=len(x) if x1 %2 == 0 if "hi"*x1 == s: print("Yes") else print("No") else: print("No")
x=input() if x == 'hi': print('Yes') elif x == 'hihi': print('Yes') elif x == 'hihihi': print('Yes') elif x == 'hihihihi': print('Yes') elif x == 'hihihihihi': print('Yes') else: print('No')
s756929895
s805149962
p02747
python
Runtime Error
x=input() x1=len(x) if x1 %2 == 0 print("yes") else print("no")
x=input() if x == 'hi': print('Yes') elif x == 'hihi': print('Yes') elif x == 'hihihi': print('Yes') elif x == 'hihihihi': print('Yes') elif x == 'hihihihihi': print('Yes') else: print('No')
s858352290
s805149962
p02747
python
Runtime Error
import itertools K,S = list(map(int,input().split())) l = set(range(K+1)) ans = 0 for x, y, z in itertools.product(l,l,l): if x + y + z == S: ans += 1 print(ans)
import itertools K,S = list(map(int,input().split())) l = set(range(K+1)) ans = 0 for x, y in itertools.product(l,l): if x + y + K >= S and x + y <= S: ans += 1 print(ans)
s485709241
s859053781
p03835
python
Time Limit Exceeded
A,B,M = map(int, input().split()) a = map(int, input().split()) b = map(int, input().split()) a_min = min(a) b_min = min(b) ans = a_min + b_min for i in range(M): x,y,c = map(int, input().split()) x -= 1 y -= 1 ans = min(ans, a[x]+b[y]-c) print(ans)
A,B,M = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) ans = min(a) + min(b) for i in range(M): x,y,c = map(int, input().split()) ans = min(ans, a[x-1]+b[y-1]-c) print(ans)
s749201393
s345834844
p02748
python
Runtime Error
s = list(input()) l = len(s) count = 0 while "ABC" in "".join(s): for i in range(l-2): if "".join(s[i:i+3]) == "ABC": s[i:i+3] = "BCA" count += 1 print(count)
s = "Z".join(input().split("BC")) l = len(s) count = 0 cue = 0 for i in range(l): if s[i] == "A": cue += 1 elif s[i] == "Z": count += cue else: cue = 0 print(count)
s226098422
s016047660
p03018
python
Time Limit Exceeded
r, g, b, n = [int(i) for i in input().split()] total = 0 rm = n//r for i in range(rm + 1): for j in range(gm + 1): bd = n - r * i - g * j if bd % b == 0: total += 1 print(total)
r, g, b, n = [int(i) for i in input().split()] total = 0 rm = n//r for rn in range(rm + 1): gm = (n - rn * r) // g for gn in range(gm + 1): bd = n - r * rn - g * gn if bd % b == 0: total += 1 print(total)
s609670666
s337015391
p03048
python
Runtime Error
n = int(input()) t = [] a = 0 b = 0 total = 0 for i in range(n): t.append(input()) total += t[-1].count("AB") a += t[-1][-1] == "A" b += t[-1][0] == "B" print(min(a,b) + total)
n = int(input()) a = 0 b = 0 ab = 0 total = 0 t = [] for i in range(n): t.append(input()) for i in t: total += i.count("AB") if i[-1] == "A" and i[0] == "B": ab += 1 else: a += i[-1] == "A" b += i[0] == "B" if ab == 0: print(total + min(a,b)) elif a == 0 and b == 0: print(total + ab - 1) elif a > 0 and b ...
s985528572
s584075957
p03049
python
Runtime Error
inp=list(map(int,input().split(" "))) N=inp[0] T=inp[1]+0.5 a=[0]*N b=[0]*N for i in range(N): inp=list(map(int,input().split(" "))) a[i]=inp[0] b[i]=inp[1] time=0 get =0 while(1): time+=1 if(time>T or len(a)==0): break need=list(map(lambda x,y:x*time+y,a,b)) mini=min(need) t...
a = input() a=a.replace("hi","") if(len(a)==0): print("Yes") else: print("No")
s196927072
s359499660
p02747
python
Runtime Error
inp = input().split(" ") A=int(inp[0]) B=int(inp[1]) M=int(inp[2]) if A!=0: a=input().split(" ") else: a=[0] if B!=0: b=input().split(" ") else: b=[0] s=[0]*(M+(1)) m=[[0]*3]*M i=0 for x in m: x=input().split(" ") s[i]=int(a[int(x[0])-1])+int(b[int(x[1])-1])-int(x[2]) i+=1 s[i]=int(min(a)...
a = input() a=a.replace("hi","") if(len(a)==0): print("Yes") else: print("No")
s565832944
s359499660
p02747
python
Runtime Error
import sys a = sys.stdin.read().split('\n')[:-1] s = list(a[0]) q = int(a[1]) f = 1 for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: l = len(s) s.insert(0 if a[i][2] == '21'[f] else l, a[i][4]) if f != 1: s.reverse() print(''.join(s))
import sys a = sys.stdin.read().split('\n')[:-1] q = int(a[1]) f = 1 l = [[], []] for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: l[0 if a[i][2] == '21'[f] else 1].append(a[i][4]) if f != 1: l[1].reverse() print(''.join(l[1]) + ''.join(reversed(list(a[0]))) + ''.join(l[0])) ...
s747140458
s287757729
p02756
python
Time Limit Exceeded
import sys a = sys.stdin.read().split('\n')[:-1] s = list(a[0]) q = int(a[1]) f = 1 for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: l = len(s) s.insert(0 if a[i][2] == '21'[f] else l, a[i][4]) if f == 1: print(''.join(s)) else: print(''.join(reversed(s)))
import sys a = sys.stdin.read().split('\n')[:-1] q = int(a[1]) f = 1 l = [[], []] for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: l[0 if a[i][2] == '21'[f] else 1].append(a[i][4]) if f != 1: l[1].reverse() print(''.join(l[1]) + ''.join(reversed(list(a[0]))) + ''.join(l[0])) ...
s780142323
s287757729
p02756
python
Time Limit Exceeded
import sys a = sys.stdin.read().split('\n')[:-1] s = list(a[0]) q = int(a[1]) f = 1 for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: l = len(s) s.insert(a[i][2] == '21'[f] ? 0 : l, a[i][4]) if f == 1: print(''.join(s)) else: print(''.join(reversed(s)))
import sys a = sys.stdin.read().split('\n')[:-1] q = int(a[1]) f = 1 l = [[], []] for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: l[0 if a[i][2] == '21'[f] else 1].append(a[i][4]) if f != 1: l[1].reverse() print(''.join(l[1]) + ''.join(reversed(list(a[0]))) + ''.join(l[0])) ...
s117551741
s287757729
p02756
python
Runtime Error
import sys a = sys.stdin.read().split('\n')[:-1] s = list(a[0]) q = int(a[1]) f = 1 for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: if a[i][2] == '21'[f]: s.insert(0, a[i][4]) else: s.append(a[i][4]) if f == 1: print(''.join(s)) else: print(''...
import sys a = sys.stdin.read().split('\n')[:-1] q = int(a[1]) f = 1 l = [[], []] for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: l[0 if a[i][2] == '21'[f] else 1].append(a[i][4]) if f != 1: l[1].reverse() print(''.join(l[1]) + ''.join(reversed(list(a[0]))) + ''.join(l[0])) ...
s902243135
s287757729
p02756
python
Time Limit Exceeded
import sys a = sys.stdin.read().split('\n')[:-1] s = a[0] q = int(a[1]) f = 1 for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: if a[i][2] == '21'[f]: s = a[i][4] + s else: s += a[i][4] if f == 1: print(s) else: b = '' for c in reversed(s): ...
import sys a = sys.stdin.read().split('\n')[:-1] q = int(a[1]) f = 1 l = [[], []] for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: l[0 if a[i][2] == '21'[f] else 1].append(a[i][4]) if f != 1: l[1].reverse() print(''.join(l[1]) + ''.join(reversed(list(a[0]))) + ''.join(l[0])) ...
s149973919
s287757729
p02756
python
Time Limit Exceeded
import sys a = sys.stdin.read().split('\n')[:-1] s = a[0] q = int(a[1]) f = 1 #for i in range(0, q): for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f if a[i][0] == '2': if a[i][2] == '21'[f]: s = a[i][4] + s else: s += a[i][4] if f == 1: print(s) else: ...
import sys a = sys.stdin.read().split('\n')[:-1] q = int(a[1]) f = 1 l = [[], []] for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: l[0 if a[i][2] == '21'[f] else 1].append(a[i][4]) if f != 1: l[1].reverse() print(''.join(l[1]) + ''.join(reversed(list(a[0]))) + ''.join(l[0])) ...
s761743949
s287757729
p02756
python
Time Limit Exceeded
import sys a = sys.stdin.read().split('\n')[:-1] s = a[0] q = int(a[1]) f = 1 for i in range(0, q): if a[2 + i][0] == '1': f = 1 - f if a[2 + i][0] == '2': if a[2 + i][2] == '21'[f]: s = a[2 + i][4] + s else: s += a[2 + i][4] if f == 1: print(s) else: b = ...
import sys a = sys.stdin.read().split('\n')[:-1] q = int(a[1]) f = 1 l = [[], []] for i in range(2, q + 2): if a[i][0] == '1': f = 1 - f else: l[0 if a[i][2] == '21'[f] else 1].append(a[i][4]) if f != 1: l[1].reverse() print(''.join(l[1]) + ''.join(reversed(list(a[0]))) + ''.join(l[0])) ...
s188720019
s287757729
p02756
python
Time Limit Exceeded
import sys from functools import reduce n, m = map(int, input().split()) ps = [r.split() for r in sys.stdin.read().split('\n') if r != ''] ps.sort(key=lambda t: int(t[0])) ac = {} wa = {} for j in range(0, m): i = int(ps[j][0]) if i in ac: continue if ps[j][1] == 'AC': ac[i] = 1 con...
import sys from functools import reduce n, m = map(int, input().split()) ps = [r.split() for r in sys.stdin.read().split('\n') if r != ''] ps.sort(key=lambda t: int(t[0])) log = [] for i in range(0, n): log.append([]) for j in range(0, m): i = int(ps[j][0]) log[i-1].append(ps[j][1]) wacount = sum(map(lambd...
s445659665
s261054548
p02802
python
Runtime Error
import sys p = [r for r in sys.stdin.read().split('\n') if r != ''] n = int(p[0]) s = p[1:] for i, r in enumerate(s): t = list(r) t.sort() s[i] = ''.join(t) total = 0 while n: a = s.pop(-1) count = 0 for i in reversed(range(0, len(s))): if s[i] == a: count += 1 s[...
import sys p = [r for r in sys.stdin.read().split('\n') if r != ''] n = int(p[0]) s = p[1:] for i, r in enumerate(s): t = list(r) t.sort() s[i] = ''.join(t) d = {} for i in s: if i in d: d[i] += 1 else: d[i] = 0 count = 0 for k, v in d.items(): count += int((v + 1) * v / 2) print...
s498415954
s543336857
p02947
python
Runtime Error
import sys p = [r for r in sys.stdin.read().split('\n') if r != ''] n = int(p[0]) s = p[1:] for i, r in enumerate(s): t = list(r) t.sort() s[i] = ''.join(t) total = 0 while len(s): a = s.pop(-1) count = 0 for i in reversed(range(0, len(s))): if s[i] == a: count += 1 ...
import sys p = [r for r in sys.stdin.read().split('\n') if r != ''] n = int(p[0]) s = p[1:] for i, r in enumerate(s): t = list(r) t.sort() s[i] = ''.join(t) d = {} for i in s: if i in d: d[i] += 1 else: d[i] = 0 count = 0 for k, v in d.items(): count += int((v + 1) * v / 2) print...
s518228856
s543336857
p02947
python
Time Limit Exceeded
import sys p = [r for r in sys.stdin.read().split('\n') if r != ''] n = int(p[0]) s = p[1:] for i, r in enumerate(s): s[i] = ''.join(sorted((c for c in r))) total = 0 while len(s): a = s.pop(-1) count = 0 for i in reversed(range(0, len(s))): if s[i] == a: count += 1 s.pop...
import sys p = [r for r in sys.stdin.read().split('\n') if r != ''] n = int(p[0]) s = p[1:] for i, r in enumerate(s): t = list(r) t.sort() s[i] = ''.join(t) d = {} for i in s: if i in d: d[i] += 1 else: d[i] = 0 count = 0 for k, v in d.items(): count += int((v + 1) * v / 2) print...
s480124235
s543336857
p02947
python
Time Limit Exceeded
import sys p = [[int(c) for c in r.split()] for r in sys.stdin.read().split('\n') if r != ''] n = p[0][0] h = p[1] h.reverse() for i, x in enumerate(h[:-1]): if x + 1 < h[i+1]: print('No') quit() if x < h[i+1]: h[i+1] -= 1 if h[i] < h[i+1]: print('No') else: print('Yes')
import sys p = [[int(c) for c in r.split()] for r in sys.stdin.read().split('\n') if r != ''] n = p[0][0] if n == 1: print('Yes') quit() h = p[1] h.reverse() for i in range(len(h)-1): if h[i] + 1 < h[i+1]: print('No') quit() if h[i] < h[i+1]: h[i+1] -= 1 if h[i] < h[i+1]: pri...
s317344560
s526575722
p02953
python
Runtime Error
L, R = list(map(int, input().split())) a = (L * (L + 1)) % 2019 for i in range(L, R + 1): for j in range(i + 1, min(i + 2019, R + 1)): if (i * j) % 2019 < a: a = (i * j) % 2019 print(a)
L, R = list(map(int, input().split())) a = (L * (L + 1)) % 2019 for i in range(L, min(R + 1, L + 2019)): for j in range(i + 1, min(i + 2020, R + 1)): if (i * j) % 2019 < a: a = (i * j) % 2019 print(a)
s983287091
s389214162
p02983
python
Time Limit Exceeded
L, R = list(map(int, input().split())) a = (L * (L + 1)) % 2019 for i in range(L, R + 1): for j in range(i + 1, min(i + 2019, R + 1)): if (i * j) % 2019 < a: a = (i * j) % 2019 print(a)
L, R = list(map(int, input().split())) a = (L * (L + 1)) % 2019 for i in range(L, min(R + 1, L + 2019)): for j in range(i + 1, min(i + 2020, R + 1)): if (i * j) % 2019 < a: a = (i * j) % 2019 print(a)
s546771880
s389214162
p02983
python
Time Limit Exceeded
L, R = list(map(int, input().split())) a = (L * (L + 1)) % 2019 for i in range(L, R + 1): for j in range(i + 1, R + 1): if (i * j) % 2019 < a: a = (i * j) % 2019 print(a)
L, R = list(map(int, input().split())) a = (L * (L + 1)) % 2019 for i in range(L, min(R + 1, L + 2019)): for j in range(i + 1, min(i + 2020, R + 1)): if (i * j) % 2019 < a: a = (i * j) % 2019 print(a)
s710199587
s389214162
p02983
python
Time Limit Exceeded
import sys def a(): p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != ''] A, P = p[0] print(int((A*3+P)/2) a()
import sys def a(): p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != ''] A, P = p[0] print(int((A*3+P)/2)) a()
s467815549
s524456934
p03029
python
Runtime Error
import sys from functools import reduce def a(): p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != ''] A, P = p[0] print(int((A*3+P)/2) a() import sys def a(): p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != ''] A, P = p[0] print(...
import sys def a(): p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != ''] A, P = p[0] print(int((A*3+P)/2)) a()
s835700154
s524456934
p03029
python
Runtime Error
import sys from functools import reduce def a(): p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != ''] A, P = p[0] print(int((A*3+P)/2) a()
import sys def a(): p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != ''] A, P = p[0] print(int((A*3+P)/2)) a()
s107000007
s524456934
p03029
python
Runtime Error
def abc127d(): N, M = (int(s) for s in input().split(" ")) A = sorted(list(int(s) for s in input().split(" "))) for i in range(0, M): B, C = (int(s) for s in input().split(" ")) r = len(list(filter(lambda x: x < C, A[:B]))) A = sorted([C for n in range(0, r)] + A[r:]) print(sum(A...
def abc127a(): A, B = (int(s) for s in input().split(" ")) answer = int(0 if A <= 5 else B / 2 if A <= 12 else B) print(answer) def main(): abc127a() main()
s952808600
s435527090
p03035
python
Runtime Error
K, X = map(int, input().split()) if (500 * K - X) >= 0 : print('Yes') else: print('No')
K, X = map(int, input().split()) if 500 * K - X >= 0 : print('Yes') else: print('No')
s108358811
s401872308
p02811
python
Runtime Error
K, X = map(int, input().split()) if (500 * K) < X : print('No') else: print('Yes')
K, X = map(int, input().split()) if 500 * K - X >= 0 : print('Yes') else: print('No')
s826304584
s401872308
p02811
python
Runtime Error
N, A, B = input().split() q, mod = divmod(N, A+B) if mod > A: print((q+1)*A) else : print(q*A+mod)
N, A, B = map(int, input().split()) q, mod = divmod(N, A+B) if mod >= A: print(q*A+A) else: print(q*A+mod)
s656454081
s964469155
p02754
python
Runtime Error
S = input() counter = 1 yorn = 1 for foot in S: if foot == 'R': if counter % 2 == 0: yorn=0 break elif foot == 'L': if counter % 2 == 1: yorn = 0 break counter++ if yorn == 1: print("Yes") else: print("No")
S = input() counter = 1 yorn = 1 for foot in S: if foot == 'R': if counter % 2 == 0: yorn=0 break elif foot == 'L': if counter % 2 == 1: yorn = 0 break counter+=1 if yorn == 1: print("Yes") else: print("No")
s257391563
s091401780
p02910
python
Runtime Error
N,M = map(int, input().split()) A = list(map(int, input().split())) for i in range(M): max_A = max(A) num_A= A.index(max_A) A[num_A] = max_A // 2 print(sum(A))
import heapq as hq N,M = map(int, input().split()) A =[-x for x in map(int, input().split())] hq.heapify(A) for i in range(M): m = A[0] hq.heappushpop(A, -((-m)//2)) print(-sum(A))
s419481729
s561370936
p02912
python
Time Limit Exceeded
N,M = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) for i in range(M): fir = A[0] // 2 if N != 1: for i in range(1, N): if fir < A[i]: A[i-1]=A[i] if i == N-1: A[i] = fir else: ...
import heapq as hq N,M = map(int, input().split()) A =[-x for x in map(int, input().split())] hq.heapify(A) for i in range(M): m = A[0] hq.heappushpop(A, -((-m)//2)) print(-sum(A))
s262741057
s561370936
p02912
python
Time Limit Exceeded
N,M = map(int, input().split()) A = list(map(int, input().split())) for i in range(M): A.sort(reverse=True) A[0] = A[0] // 2 print(sum(A))
import heapq as hq N,M = map(int, input().split()) A =[-x for x in map(int, input().split())] hq.heapify(A) for i in range(M): m = A[0] hq.heappushpop(A, -((-m)//2)) print(-sum(A))
s817478124
s561370936
p02912
python
Time Limit Exceeded
N = int(input()) l = [list(map(int, input().split())) for i in range(n)] l.sort(key= x:x[1]) t=0 for i in l: a,b=i t+=a if(t>b): print("No") break else: print("Yes")
S = input() n=0 b=0 while n<3 : if S[n]==S[n+1]: b=1 n+=1 if b==1: print("Bad") else: print("Good")
s158200172
s310920700
p02993
python
Runtime Error
N = int(input()) l = [list(map(int, input().split())) for i in range(n)] l.sort(key= lambda x:x[1]) t=0 for i in l: a,b=i t+=a if(t>b): print("No") break else: print("Yes");
N = int(input()) l = [list(map(int, input().split())) for i in range(N)] l.sort(key= lambda x:x[1]) t=0 cnt=0 for i in l: cnt+=1 a,b=i t+=a if(t>b): print("No") break elif cnt==N: print("Yes");
s753006526
s756251915
p02996
python
Runtime Error
N = int(input()) l = [list(map(int, input().split())) for i in range(n)] l.sort(key= x:x[1]) t=0 for i in l: a,b=i t+=a if(t>b): print("No") break else: print("Yes")
N = int(input()) l = [list(map(int, input().split())) for i in range(N)] l.sort(key= lambda x:x[1]) t=0 cnt=0 for i in l: cnt+=1 a,b=i t+=a if(t>b): print("No") break elif cnt==N: print("Yes");
s593754472
s756251915
p02996
python
Runtime Error
N, X = map(int, input().split()) L = [int(i) for i in input().split()] d=0 for i in range(N+1): if d>X : print(i) break if i == N : print(i+1) d += L[i]
N, X = map(int, input().split()) L = [int(i) for i in input().split()] d=0 for i in range(N): d += L[i] if d>X : print(i+1) break if i == N-1 : print(N+1)
s758497852
s256291068
p03000
python
Runtime Error
N, M = map(int, input().split()) def fib(n) : if n==1 : return 1 elif n==0 : return 1 else : return fib(n-1) + fib(n-2) a=[] b=1 for i in range(M): a.append(int(input())) if a[i]-a[i-1] == 1 : b=0 def rest(num) : return num % 1000000007 c=0 if b==0 : print(c...
N, M = map(int, input().split()) def fib(n) : a, b = 1, 1 if n==0 : return a elif n==1 : return b else : for i in range(n-1): a, b = b, a+b return b a=[] b=1 for i in range(M): a.append(int(input())) if a[i]-a[i-1] == 1 : b=0 def rest(num) : ...
s272012607
s826097382
p03013
python
Runtime Error
nm = [int(s) for s in input().split()] def fib(n) : if n==1 : return 1 elif n==0 : return 1 else : return fib(n-1) + fib(n-2) a=[] b=1 for i in range(nm[1]): a.append(int(input())) if a[i]-a[i-1] == 1 : b=0 def rest(num) : return num % 1000000007 c=0 if b==0 : ...
N, M = map(int, input().split()) def fib(n) : a, b = 1, 1 if n==0 : return a elif n==1 : return b else : for i in range(n-1): a, b = b, a+b return b a=[] b=1 for i in range(M): a.append(int(input())) if a[i]-a[i-1] == 1 : b=0 def rest(num) : ...
s211873129
s826097382
p03013
python
Runtime Error
s = input()[8] print('A' + s + 'C')
s = input()[8] print('A' + s + 'C')
s334042219
s212037294
p03860
python
Runtime Error
# coding: utf-8 import sys def main(argv=sys.argv): N, K = map(int, input().split()) print(K * ((K - 1) ** (N - 1))) return 0 if __name__ == '__main__': sys.exit(main())
# coding: utf-8 def main(): penki_list = input().split(' ') # setは重複する要素を持たない→複数のデータをまとめる # lenは要素の数 print(len(set(penki_list))) return 0 if __name__ == '__main__': main()
s615993764
s606639994
p03962
python
Runtime Error
A, B, M = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) x = [0] * M y = [0] * M c = [0] * M min = 99999999 for i in range(M): x[i], y[i], c[i] = map(int, input().split()) cost = a[x[i] - 1] + b[y[i] - 1] - c[i] if cost < min: min = cost for i i...
input = input() if len(input) % 2: print("No") exit(0) result = "Yes" isHi = False for i in range(len(input)-1): if isHi: isHi = False continue; str = input[i] + input[i+1] if str != "hi": result = "No" break isHi = True print(result)
s252215903
s428859183
p02747
python
Runtime Error
import re index = re.search(r'.*(hi)+.*, input()) if index: print("Yes") else: print("No")
import re index = re.fullmatch(r'(hi)+', input()) if index: print("Yes") else: print("No")
s517916492
s577861290
p02747
python
Runtime Error
import re index = re.match(r'*(hi)+*', input()) if index: print("Yes") else: print("No")
import re index = re.fullmatch(r'(hi)+', input()) if index: print("Yes") else: print("No")
s356247953
s577861290
p02747
python
Runtime Error
import re index = re.search(input(),(hi)+) if index: print("Yes") else: print("No")
import re index = re.fullmatch(r'(hi)+', input()) if index: print("Yes") else: print("No")
s475072441
s577861290
p02747
python
Runtime Error
import re index = re.search(input(),'hi') if index != -1: print("Yes") else if : print("No")
import re index = re.fullmatch(r'(hi)+', input()) if index: print("Yes") else: print("No")
s307068785
s577861290
p02747
python
Runtime Error
if ("hi" in str(S)): print("Yes") else: print("No")
import re index = re.fullmatch(r'(hi)+', input()) if index: print("Yes") else: print("No")
s495493423
s577861290
p02747
python
Runtime Error
if ("hi" in S): print("Yes") else: print("No")
import re index = re.fullmatch(r'(hi)+', input()) if index: print("Yes") else: print("No")
s139835005
s577861290
p02747
python
Runtime Error
N,K = map(int, input().split()) P=[(int(x)+1)/2 for x in input().split()] max=0 for i in range(N-K+1): kitai=0 for k in range(K): kitai+=P[i+k] if max<kitai: max=kitai print(max)
N,K = map(int, input().split()) P=[(float(x)+1)/2 for x in input().split()] #print(P) max=0 kitai=0 for i in range(K): kitai+=P[i] max=kitai for i in range(N-K): kitai-=P[i] kitai+=P[i+K] if max<kitai: max=kitai print(max)
s144217882
s598930938
p02780
python
Time Limit Exceeded
L,R=map(int,input().split()) min=2019 for i in range(L,R+1): for k in range(i+1,R+1): mod=(i*k)%2019 if mod==0: min=0 break if mod<min: min=mod else: continue break print(min)
L,R=map(int,input().split()) min=2019 for i in range(L,R+1): for k in range(i+1,R+1): mod=(i*k)%2019 if mod<min: min=mod if mod==0: min=0 break else: continue break print(min)
s609124043
s349834755
p02983
python
Runtime Error
input = input() if len(input.replace("hi", "")) == 0: print("Yes") else print("No")
input = input() if len(input.replace("hi", "")) == 0: print("Yes") else: print("No")
s122274441
s949499837
p02747
python
Runtime Error
a = int(raw_input()) print(48 - a)
import fileinput for line in fileinput.input(): print(48 - int(line))
s654999033
s602918030
p03473
python
Runtime Error
n = int(input()) if 'hi' in n: print("Yes") else: print("No")
n = raw_input() length = len(n) if length % 2 == 0: if n.count('hi')==length/2: print("Yes") else: print("No") else: print("No")
s134233429
s393962239
p02747
python
Runtime Error
ab = input().split(" ") a = int(ab[0]) b = int(ab[1]) def check(a,b): if (a>9 or b>9): return -1 else return a*b print(check(a,b))
ab = input().split(" ") a = int(ab[0]) b = int(ab[1]) def check(a,b): if (a>9 or b>9): return -1 else: return a*b ans = check(a,b) print(ans)
s364988995
s925707848
p02879
python
Runtime Error
nk = input().split(' ') n = int(nk[0]) k = int(nk[1]) a = input().split(' ') count = 0 sum = 0 for i in range(n): # print(i) sum = int(a[i]) j = i+1 if k<=sum : count = count + 1 while j<n: sum = sum + int(a[j]) # print("sum:{} j:{} a[j]:{}".format(sum,j,a[j])) if k<=sum : count = count + ...
xa = input().split(" ") x = int(xa[0]) a = int(xa[1]) if x<a: print("0") elif a<=x: print("10") else: print("error")
s495681416
s929107260
p02999
python
Runtime Error
import copy n=int(input()) a=[] for i in range(n): item = int(input()) a.append(item) count = 0 t = True while t: b=[] for j in a: if j%2==0: b.append(j/2) elif j<2: t=False else: t=False if t== False: break count = coutn +1 a=copy.deepcopy(b) print(count)
import copy n=int(input()) a=input().split(" ") count = 0 t=True while t: b=[] for j in a: if int(j)%2 == 0: b.append(int(j)/2) elif int(j)<2: t=False else: t=False if t==False: break count = count+1 a=copy.deepcopy(b) print(count)
s732036277
s692865583
p03494
python
Runtime Error
# coding: utf-8 def main(): n = int(input()) point = list(map(int, input().split(' '))) max_point = max(point) min_point = min(point) min_sums = [] for p in range(min_point, max_point + 1): sum_ = 0 for x in numbers: sum_ += (x - p) ** 2 min_sums.append...
# coding: utf-8 def main(): n = int(input()) numbers = list(map(int, input().split(' '))) max_number = max(numbers) min_number = min(numbers) min_sums = [] for p in range(min_number, max_number + 1): sum_ = 0 for x in numbers: sum_ += (x - p) ** 2 min_s...
s068718094
s528006600
p02767
python
Runtime Error
# coding: utf-8 import sys def main(): n = int(input()) a = int(input()) b = n // a if (n - b * 500) <= a: print('Yes') else: print('No') return 0 if __name__ == '__main__': main()
# coding: utf-8 import sys def main(): n = int(input()) a = int(input()) if n % 500 != 0 and a == 0: print('No') elif (n - (n // 500) * 500) <= a: print('Yes') else: print('No') return 0 if __name__ == '__main__': main()
s064861909
s235272957
p03433
python
Runtime Error
# coding: utf-8 import sys def main(argv=sys.argv): dict = {input().split()} print(dict) return 0 if __name__ == '__main__': sys.exit(main())
# coding: utf-8 import sys def main(argv=sys.argv): set1 = set(input().split()) print(len(set1)) return 0 if __name__ == '__main__': sys.exit(main())
s340504657
s995742080
p03962
python
Runtime Error
S, T= input().split() A, B= map(int, input().split()) U= input().split() if (S==U): print(A-1,B) else if (T==U): print(A,B-1) else: print(A,B)
S, T= input().split() A, B= map(int, input().split()) U= input() if (S == U): print(A-1,B) elif (T == U): print(A,B-1) else: print(A,B)
s041473385
s894838380
p02777
python
Runtime Error
S, T= input().split() A, B= map(int, input().split()) U= input().split() if (S==U): print(A-1,B) else if (T==U): print(A,B-1)
S, T= input().split() A, B= map(int, input().split()) U= input() if (S == U): print(A-1,B) elif (T == U): print(A,B-1) else: print(A,B)
s194500804
s894838380
p02777
python
Runtime Error
S,T=input().split() A,B=map(int, input().split()) U=input().split() if(S==U):print(A-1,B) else if(T==U):print(A,B-1)
S, T= input().split() A, B= map(int, input().split()) U= input() if (S == U): print(A-1,B) elif (T == U): print(A,B-1) else: print(A,B)
s971290486
s894838380
p02777
python
Runtime Error
S, T= input().split() A, B= map(int, input().split()) U= input().split() if (S==U): print(str(A-1) B) else: print(A str(B-1))
S, T= input().split() A, B= map(int, input().split()) U= input() if (S == U): print(A-1,B) elif (T == U): print(A,B-1) else: print(A,B)
s146765177
s894838380
p02777
python
Runtime Error
S, T= input().split() A, B= map(int, input().split()) U= input().split() if (S==U): print(A-1 B) else: print(A B-1)
S, T= input().split() A, B= map(int, input().split()) U= input() if (S == U): print(A-1,B) elif (T == U): print(A,B-1) else: print(A,B)
s121182787
s894838380
p02777
python
Runtime Error
S, T= input().split() A, B= int(input().split()) U= input().split() if (S==U): print(A-1 B) else: print(A B-1)
S, T= input().split() A, B= map(int, input().split()) U= input() if (S == U): print(A-1,B) elif (T == U): print(A,B-1) else: print(A,B)
s301165560
s894838380
p02777
python
Runtime Error
import re S = int(input()) print(re.sub(r"[a-z]", "x", S))
import re s = input() print(re.sub(r"[a-z]", "x", s))
s222130049
s380602948
p02778
python
Runtime Error
a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) k = int(input()) l = [e, d, c, b, a] de = e - d ce = e - c cd = d - c be = e - b bd = d - b bc = c - b ae = e - a ad = d - a ac = c - a ab = b - a distance = [ab, ac, ad, ae, bc, bd,be, cd, ce, de] output = [] ok = 'Yay!' bad = ':(' fo...
a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) k = int(input()) de = e - d ce = e - c cd = d - c be = e - b bd = d - b bc = c - b ae = e - a ad = d - a ac = c - a ab = b - a distance = [ab, ac, ad, ae, bc, bd, be, cd, ce, de] output = [] ok = 'Yay!' bad = ':(' for i in distance: ...
s912112877
s965836849
p03075
python
Runtime Error
a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) l = [a, b, c, d, e] l_times_ten = [] amari_list = [] for i in range(len(l)): amari = l[i] % 10 if amari == 0: l_times_ten.append(l[i]) elif amari != 0: amari_list.append(amari) l_tmp = l[i] +(10 - ...
a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) l = [a, b, c, d, e] l_times_ten = [] amari_list = [] for i in range(len(l)): amari = l[i] % 10 if amari == 0: l_times_ten.append(l[i]) elif amari != 0: amari_list.append(amari) l_tmp = l[i] +(10 - ...
s976236496
s886515732
p03076
python
Runtime Error
a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) l = [a, b, c, d, e] l_times_ten = [] amari_list = [] time = 0 for i in range(len(l)): amari = l[i] % 10 if amari == 0: l_times_ten.append(l[i]) elif amari != 0: amari_list.append(amari) l_tmp = l[i...
a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) l = [a, b, c, d, e] l_times_ten = [] amari_list = [] for i in range(len(l)): amari = l[i] % 10 if amari == 0: l_times_ten.append(l[i]) elif amari != 0: amari_list.append(amari) l_tmp = l[i] +(10 - ...
s095202973
s886515732
p03076
python
Runtime Error
a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) l = [a, b, c, d, e] l_times_ten = [] amari_list = [] time = 0 for i in range(len(l)): amari = l[i] % 10 if amari == 0: l_times_ten.append(l[i]) elif amari != 0: amari_list.append(amari) l_tmp = l[i...
a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) l = [a, b, c, d, e] l_times_ten = [] amari_list = [] for i in range(len(l)): amari = l[i] % 10 if amari == 0: l_times_ten.append(l[i]) elif amari != 0: amari_list.append(amari) l_tmp = l[i] +(10 - ...
s884720696
s886515732
p03076
python
Runtime Error
a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] ans = 0 be = 0 for i in range(a[0]-a[1]+1): sum = 0 if be < b[i+a[1]-1]: for j in range(a[1]): sum += (1 + b[i+j])/2 if ans < sum: ans = sum be = b[i] print(ans)
a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] sum = 0 ans = 0 for i in range(a[0]): sum += (1 + b[i])/2 if i > a[1]-1: sum -= (1 + b[i-a[1]])/2 if ans < sum: ans = sum print(ans)
s627112161
s302226265
p02780
python
Time Limit Exceeded
a = input().split() b = input().split() ans = 0 be = 0 for i in range(int(a[0])-int(a[1])+1): sum = 0 if be < int(b[i+int(a[1])-1]): for j in range(int(a[1])): sum += (1 + int(b[i+j]))/2 if ans < sum: ans = sum be = int(b[i]) print(ans)
a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] sum = 0 ans = 0 for i in range(a[0]): sum += (1 + b[i])/2 if i > a[1]-1: sum -= (1 + b[i-a[1]])/2 if ans < sum: ans = sum print(ans)
s123621667
s302226265
p02780
python
Time Limit Exceeded
a = input().split() b = input().split() ans = 0 for i in range(int(a[0])-int(a[1])+1): sum = 0 for j in range(int(a[1])): sum += (1 + int(b[i+j]))/2 if ans < sum: ans = sum print(ans)
a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] sum = 0 ans = 0 for i in range(a[0]): sum += (1 + b[i])/2 if i > a[1]-1: sum -= (1 + b[i-a[1]])/2 if ans < sum: ans = sum print(ans)
s137684404
s302226265
p02780
python
Time Limit Exceeded
a = input().split() b = input().split() exlist = [] for i in range(int(a[0])): exlist.append((1 + int(b[i]))/2) ans = 0 for i in range(int(a[0])-int(a[1])+1): sum = 0 for j in range(int(a[1])): sum += exlist[i+j] if ans < sum: ans = sum print(ans)
a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] sum = 0 ans = 0 for i in range(a[0]): sum += (1 + b[i])/2 if i > a[1]-1: sum -= (1 + b[i-a[1]])/2 if ans < sum: ans = sum print(ans)
s422330388
s302226265
p02780
python
Time Limit Exceeded
a = input().split() b = input().split() exlist = [] for i in range(int(a[0])): sum = 0 for j in range(int(b[i])+1): sum += j exlist.append(sum/int(b[i])) ans = 0 for i in range(int(a[0])-int(a[1])+1): sum = 0 for j in range(int(a[1])): sum += exlist[i+j] if ans < sum: ...
a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] sum = 0 ans = 0 for i in range(a[0]): sum += (1 + b[i])/2 if i > a[1]-1: sum -= (1 + b[i-a[1]])/2 if ans < sum: ans = sum print(ans)
s649494132
s302226265
p02780
python
Time Limit Exceeded
A,B,M=list(map(int, input().split())) a=list(map(int, input().split())) b=list(map(int, input().split())) mi=min(a)+min(b) for i in range(0,M): Data=list(map(int, input().split())) wari=a[Data[0]]+b[Data[1]]-Data[2] if(mi>wari): mi=wari print(mi)
A,B,M=list(map(int, input().split())) a=list(map(int, input().split())) b=list(map(int, input().split())) mi=min(a)+min(b) for i in range(0,M): Data=list(map(int, input().split())) wari=a[Data[0]-1]+b[Data[1]-1]-Data[2] if(mi>wari): mi=wari print(mi)
s034359939
s858338049
p02748
python
Runtime Error
# -*- coding: utf-8 -*- # 文字列の入力 a = int(input()) li = list(map(int, input().split())) li2 = [] for i in range(a): li2.append(li[i]) if len(li2) != len(set(li2)): print('NO') else: print('YES')
# -*- coding: utf-8 -*- # 整数の入力 a, b = map(str, input().split()) # スペース区切りの整数の入力 c, d = map(int, input().split()) # 文字列の入力 e = str(input()) if a == e: c = c - 1 elif b ==e: d = d - 1 # 出力 print("{} {}".format(c, d))
s624461124
s900786767
p02777
python
Runtime Error
money,sum=int(input().split()) money500=500*money if money500>=sum: print('Yes') else: print('No')
money,sum=map(int,input().split()) money500=500*money if money500>=sum: print('Yes') else: print('No')
s413706328
s586638682
p02811
python
Runtime Error
money=int(input().split()) sum=int(input()) money500=500*money if money500>=sum: print('Yes') else: print('No')
money,sum=map(int,input().split()) money500=500*money if money500>=sum: print('Yes') else: print('No')
s480188953
s586638682
p02811
python
Runtime Error
money=int(input()) sum=int(input()) money500=500*money if money500>=sum: print('Yes') else: print('No')
money,sum=map(int,input().split()) money500=500*money if money500>=sum: print('Yes') else: print('No')
s746375763
s586638682
p02811
python
Runtime Error