problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03309
s359961051
Accepted
n=int(input()) a=list(map(int,input().split())) for i in range(n): a[i]-=i a.sort() b=(a[n//2]+a[(n-1)//2])//2 print(sum(abs(i-b) for i in a))
p02718
s097327713
Accepted
n,m=map(int,input().split()) a=list(map(int,input().split())) a_sum=sum(a) count=0 for i in a: if i>=a_sum/(4*m): count+=1 if count>=m: print("Yes") else: print("No")
p02994
s178670884
Wrong Answer
# 131 B n, l = map(int, input().split()) cmin = float('inf') sum = 0 for i in range(1, n+1): f = l + i - 1 sum += f if f >= 0: cmin = min(cmin, f) else: cmin = max(cmin, f) print(sum - cmin)
p03416
s093932112
Wrong Answer
a, b = map(int, input().split()) count = 0 for i in range(a, b): str_i = str(i) if str_i[0] == str_i[4] and str_i[1] == str_i[3]: count += 1 print(count)
p02633
s238973164
Accepted
x = int(input()) y = x while y % 360: y += x print(y//x)
p02694
s897199395
Accepted
money = int(input()) count = 0 x = 100 while True: x = int(x + x * 0.01) count = count + 1 if x >= money: break print(count)
p02717
s380525042
Accepted
X, Y, Z = map(int, input().split()) X, Y = Y, X X, Z = Z, X print(X, Y, Z)
p02924
s422673969
Wrong Answer
N = int(input()) ans = N*(N-1)/2 print(int(ans))
p04044
s650786293
Accepted
# B - 文字列大好きいろはちゃんイージー # https://atcoder.jp/contests/abc042/tasks/abc042_b n, l = map(int, input().split()) S = [input() for _ in range(n)] S.sort() print("".join(S))
p03730
s642889922
Wrong Answer
x, y, z = map(int,input().split()) if x%y == 0 and z != 0: print("NO") else: print("YES")
p02912
s920163519
Wrong Answer
import heapq n,m=map(int,input().split()) a=list(map(int,input().split())) b=[-int(i) for i in a] heapq.heapify(b) for i in range(m): x=heapq.heappop(b)//2 heapq.heappush(b,x) print(-sum(b))
p03262
s624031504
Wrong Answer
N, X = map(int, input().split()) x = list(map(int, input().split())) x.append(X) x.sort() a = [None] * N for i in range(1, N+1): a[i-1] = x[i] - x[i-1] mn = min(a) for m in a: if m % mn != 0: print(1) break else: print(mn)
p02793
s549761121
Accepted
from fractions import* from functools import* M=10**9+7 _,a=open(0) *a,=map(int,a.split()) s=reduce(lambda x,y:x//gcd(x,y)*y,a)%M c=0 for i in a: c+=s*pow(i,M-2,M) c%=M print(c)
p03971
s603205092
Wrong Answer
n, a, b = map(int, input().split()) s = input() ca, cb = 0, 0 for i in s: if i == 'c': print('No') elif i == 'a' and (ca+cb) < (a+b): ca += 1 print('Yes', 'ca =', ca, 't =',ca+cb) elif (i == 'b' and (ca+cb) < (a+b) and cb < b): cb += 1 print('Yes', 'cb =', cb, 't =',ca+cb) else: print('No')
p03075
s227886414
Accepted
A = [int(input()) for i in range(6)] if A[4] - A[0] > A[5]: print(":(") else: print("Yay!")
p04030
s843324935
Accepted
s = input() ans = '' for si in s: if si == 'B': if ans == '': continue else: ans = ans[:-1] else: ans += si print(ans)
p03077
s521627639
Accepted
n,*ti = [int(input()) for _ in range(6)] import math print(4 + math.ceil(n/min(ti)))
p03339
s072749573
Accepted
n = int(input()) s = input() w = [0]*(n + 2) e = [0]*(n + 2) ans = 100000000 for i in range(1, n + 1): w[i] += w[i - 1] e[-i - 1] += e[-i] if s[i - 1] == "W": w[i] += 1 if s[-i] == "E": e[-i - 1] += 1 for i in range(1, n + 1): ref = e[i + 1] ref += w[i - 1] ans = min(ans, ref) print(ans)
p02705
s137457194
Wrong Answer
a = int(input()) print(3.14159265 * a *a)
p03241
s460910808
Accepted
N, M = map(int, input().split()) ans = 0 for i in range(1, int(M**0.5)+1): if M % i == 0: if i * N <= M: ans = max(ans, i) if (M // i) * N <= M: ans = max(ans, M // i) print(ans)
p02859
s030110916
Wrong Answer
int(input())**2
p03495
s518929367
Wrong Answer
n,k = map(int,input().split()) A = list(map(int,input().split())) ans = 0 for a in A: if a > k: ans += 1 print(ans)
p03331
s141401389
Wrong Answer
n = int(input()) mn = 10**10 for a in range(1, n // 2): mn = min(mn, sum(int(i) for i in str(a)) + sum(int(i) for i in str(n-a))) print(mn)
p03827
s495465190
Accepted
n = int(input()) s = input() x = 0 l = 0 for i in range(n): if s[i] == 'I': x += 1 else: x -= 1 l = max(l,x) print(l)
p03317
s586182166
Wrong Answer
import math N, K = map(int, input().split()) A = list(input().split()) A_lis = [int(A[i]) for i in range(N)] index = A_lis.index(1) if N == K: print(1) else: left = math.ceil(index / (K-1)) leftamari = index % (K-1) right = math.ceil(max(0, N - K - index + leftamari) / (K-1)) print(left + right)
p03665
s617026032
Accepted
from math import factorial def com(n, r): return fac_n // factorial(r) // factorial(n - r) N, P = map(int, input().split()) A = [int(x) for x in input().split()] odd, even = 0, 0 for i in range(N): if A[i] % 2 == 1: odd += 1 else: even += 1 fac_n = factorial(odd) res = 0 for r in range(P, odd+1, 2): res += com(odd, r) ans = res * (2**even) print(ans)
p03345
s910232710
Accepted
import sys sys.setrecursionlimit(10 ** 8) input = sys.stdin.readline def main(): A, B, C, K = [int(x) for x in input().split()] ans = A - B if K % 2 == 0: print(ans) else: print(-ans) if __name__ == '__main__': main()
p02973
s059038263
Wrong Answer
#!usr/bin/env python3 import sys import math import string import collections import fractions import random from operator import itemgetter import itertools from collections import deque import copy import heapq import bisect MOD = 10 ** 9 + 7 INF = float('inf') input = lambda: sys.stdin.readline().strip() sys.setrecursionlimit(10 ** 8) N = int(input()) check = [0]*(N+1) A = [int(input()) for _ in range(N)] LIS = [INF]*(N+1) for i in range(N): temp = bisect.bisect_left(LIS, A[i]) check[temp] += 1 LIS[temp] = A[i] print(max(check))
p02801
s363818958
Accepted
a = 'abcdefghijklmnopqrstuvwxyz' c = input() print(a[a.index(c)+1])
p04033
s817693388
Accepted
a, b = list(map(int, input().split())) if a > 0: ans = 'Positive' elif a <= 0 and b >= 0: ans = 'Zero' else: neg = b - a + 1 if neg % 2 == 0: ans = 'Positive' else: ans = 'Negative' print(ans)
p03417
s666687687
Wrong Answer
n,m = map(int,input().split()) if n >= 2 and m >= 2: print((n-2)*(m-2)) elif n == 1: print(m-2) else: print(n-2)
p02832
s462999798
Wrong Answer
N = int(input()) A = list(map(int, input().split())) ex = list(range(1, N + 1)) is_good = 0 for i in range(N): if A[i] == ex[i]: is_good += 1 print(-1 if is_good == 0 else N - is_good)
p02645
s470218364
Wrong Answer
import random S = input() i=random.randint(0,len(S)-3) print(S[i:i+2])
p02711
s034799603
Accepted
N = input() if "7" in N: print("Yes") else: print("No")
p02814
s642716839
Accepted
from math import gcd N, M = map(int, input().split()) A = list(map(int, input().split())) lcm = 1 for a in A: lcm = lcm * a // gcd(lcm, a) if lcm > M*2: print(0) exit() for a in A: if lcm // a % 2 == 0: print(0) exit() ans = M // (lcm//2) - M // lcm print(ans)
p02787
s299199665
Accepted
h,n=map(int,input().split()) inf=100000000000 dp=[inf]*(h+1) dp[h]=0 for i in range(n): a,b=map(int,input().split()) for j in range(h,-1,-1): dp[max(j-a,0)]=min(dp[max(j-a,0)],dp[j]+b) print(dp[0])
p03448
s707700105
Accepted
a = int(input()) b = int(input()) c = int(input()) y = int(input()) ans = 0 for ai in range(a+1): for bi in range(b+1): for ci in range(c+1): amount = 500 * ai + 100 * bi + 50 * ci if amount == y: ans += 1 print(ans)
p03815
s939012131
Accepted
x=int(input()) count=0 a=x//11 b=x-a*11 if b==0: print(a*2) elif b>=1 and b<=6: print(a*2+1) else: print(a*2+2)
p03077
s320238395
Accepted
N = int(input()) L = [] for _ in range(5): L.append(int(input())) mn = min(L) ans = (-(-N//mn)) + 4 print(ans)
p03211
s489425843
Accepted
N=input() l=753 sa=999999999999 for i in range(len(N)-2): k=int(N[i]+N[i+1]+N[i+2]) #print(k) if abs(k-l)<sa: sa=abs(k-l) print(sa)
p03838
s107239799
Wrong Answer
x,y = map(int,input().split()) ch = max(abs(x),abs(y)) - min(abs(x),abs(y)) if x <= 0 and y == 0: print(ch) elif x*y <= 0: print(ch+1) elif x*y >= 0 and x >= y: print(ch+2) else: print(ch)
p02725
s868873386
Wrong Answer
K,N=map(int,input().split()) A=list(map(int,input().split())) for i in range(1,N): L=0 L=max(L,A[i]-A[i-1]) L=max(L,K-A[-1]+A[0]) print(K-L)
p03161
s525764355
Wrong Answer
from sys import stdin,stdout INT_MAX= 100000000 n,k=map(int,stdin.readline().split()) dp = [INT_MAX]*(n) h=[int(X) for X in stdin.readline().split()] dp[0]=0 dp[1]=abs(h[1]-h[0]) for i in range(2,n): p=1 while(p<k+1 and i-p>=0): dp[i]= min(dp[i-p+1]+abs(h[i-p+1]-h[i]),dp[i]) p+=1 stdout.write(str(dp[n-1])+"\n")
p02717
s819214650
Accepted
x, y, z= input().split() w=z z=y y=x x=w print(x, y, z)
p02829
s162898016
Accepted
import sys input = sys.stdin.readline A = int(input()) B = int(input()) ans = [1,2,3] for value in ans: if A == value or B == value: continue else: print(value)
p02678
s251542028
Accepted
from collections import deque N,M = map(int,input().split()) adj = [list() for _ in range(N)] for _ in range(M): a,b = map(int,input().split()) adj[a-1].append(b-1) adj[b-1].append(a-1) parent = [None]*N queue = deque([0]) while queue: u = queue.popleft() for v in adj[u]: if parent[v] is None: parent[v] = u queue.append(v) print('Yes') print(*(x+1 for x in parent[1:]), sep='\n')
p02766
s976510068
Wrong Answer
N,K=map(int, input().split()) for i in range(9999): if K**i<=N<=K**(i+1): print(i+1)
p02952
s261174453
Wrong Answer
a = int(input()) count = 0 for i in range(1,a): if len(str(i))%2 != 0: count += 1 print(count)
p02771
s244193909
Wrong Answer
a, b, c = map(int, input().split()) if a==b==c or (a!=b and b!=c and c !=a): print('No') else: print('No')
p03012
s021782867
Accepted
N, *W = map(int, open(0).read().split()) m = 100 for i in range(N-1): a = sum(W[:i+1]) b = sum(W[i+1:]) n = abs(a-b) if m > n: m = n print(m)
p02556
s121680719
Accepted
N=int(input()) xp=yp=0 xn=yn=10**9 zs=[0]*N ws=[0]*N for i in range(N): xi,yi=map(int,input().split()) zs[i]=xi+yi ws[i]=xi-yi zs.sort() ws.sort() ans=max(zs[-1]-zs[0],ws[-1]-ws[0]) print(ans)
p04031
s149381221
Accepted
import math n, *a = map(int, open(0).read().split()) y1 = math.ceil(sum(a)/n) y2 = sum(a)//n ans1 = 0 ans2 = 0 for i in range(n): ans1 += (a[i] - y1) ** 2 ans2 += (a[i] - y2) ** 2 print(min(ans1,ans2))
p02963
s383381589
Accepted
S = int(input()) p = 10 ** 9 if S > p: r = S % p r = 0 if r == 0 else p - r print(p, 1, r, (S + r) // p, 0, 0) else: print(1, 0, 0, S, 0, 0)
p03797
s003025103
Accepted
N,M=map(int,input().split()) if M<=2*N: print(M//2) else: print(N+(M-2*N)//4)
p02747
s483709800
Accepted
s = input() l = s[0::2] m = s[1::2] if set(l) == {'h'} and set(m) == {'i'} and len(s)%2==0: print('Yes') else: print('No')
p02917
s666548142
Accepted
n = input() B = list(map(int,input().split())) A = [B[0]] for i,b in enumerate(B): A[i] = min(A[i],B[i]) A.append(max(B[i],A[i])) print(sum(A))
p04005
s566966501
Accepted
ABC = list(map(int,input().split())) ABC.sort() mid = ABC[-1] // 2 print(abs(ABC[0] * ABC[1] * mid - ABC[0] * ABC[1] * (ABC[2]-mid)))
p02744
s444546629
Accepted
n = int(input()) def dfs(s, cn): if len(s) == n: print(s) else: for i in range(0, cn + 1): c = chr(ord('a') + i) if i == cn: dfs(s+c, cn+1) else: dfs(s+c, cn) dfs('', 0)
p03071
s852336812
Accepted
a, b = map(int, input().split()) ans = 0 for _ in range(2): if a > b: ans += a a -= 1 else: ans += b b -= 1 print(ans)
p02859
s598545794
Accepted
r = int(input()) print(r*r)
p03351
s730198730
Accepted
A, B, C, D = map(int, input().split()) print('Yes' if abs(A-C)<=D or (abs(A-B)<=D and abs(B-C)<=D) else 'No')
p03408
s562452379
Accepted
n=[input() for i in range(int(input()))] m=[input() for i in range(int(input()))] l=list(set(n)) x=0 for i in l: y=max(0,n.count(i)-m.count(i)) if y > x: x=y print(x)
p03252
s978505170
Accepted
import sys s = input() t = input() dic = {'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7,'i':8,'j':9,'k':10,'l':11,'m':12,'n':13,'o':14,'p':15,'q':16,'r':17,'s':18,'t':19,'u':20,'v':21,'w':22,'x':23,'y':24,'z':25} sl = [0]*26 tl = [0]*26 for i in s: sl[dic[i]] += 1 for i in t: tl[dic[i]] += 1 sl.sort() tl.sort() for i in range(26): if sl[i] != tl[i]: print("No") sys.exit() print("Yes")
p03161
s251568501
Accepted
N, K = map(int, input().split()) h = list(map(int, input().split())) #dp[i]:i番目に到達するまでにはらうコストの最小値 INF = float('inf') dp = [INF for i in range(N)] dp[0] = 0 for i in range(0,N): for k in range(1, K+1): if i+k > N-1: break dp[i+k] = min(dp[i+k], dp[i]+abs(h[i+k]-h[i])) print(dp[N-1])
p04030
s992131144
Accepted
li = list(input()) ans = [] for i in range(len(li)): if (li[i] == '0') or (li[i] == '1'): ans.append(li[i]) elif len(ans) > 0: ans.pop() else: pass print(''.join(ans))
p03836
s201691404
Accepted
sx,sy,tx,ty = map(int,input().split()) S = [] S += "U"*(ty - sy), S += "R"*(tx - sx), S += "D"*(ty - sy), S += "L"*(tx - sx + 1), S += "U"*(ty - sy + 1), S += "R"*(tx - sx + 1), S += "D", S += "R", S += "D"*(ty - sy + 1), S += "L"*(tx - sx + 1), S += "U" print(*S, sep = "")
p03284
s329240287
Accepted
n,k=map(int,input().split()) if n%k==0: print(0) else: print(1)
p03035
s742943009
Accepted
A, B = map(int, input().split()) if A >= 13: print(B) elif A >= 6: print(B // 2) else: print(0)
p03208
s403308823
Accepted
n, k = list(map(int, input().split())) #n, m = list(map(int, input().split())) h = [] for i in range(n): h.append(int(input())) h.sort() dif_min =max(h) for i in range(n-k+1): dif = h[i+k-1]-h[i] #print(str(h[i])+" "+str(h[i+k-1])) if dif < dif_min: dif_min = dif print(dif_min)
p03407
s806555535
Accepted
A,B,C=map(int,input().split()) if C <= A+B: ans="Yes" else: ans="No" print(ans)
p02556
s571703216
Accepted
n = int(input()) xy = [list(map(int, input().split())) for _ in range(n)] xzy = [] for _ in range(4): xzy.append([]) for x, y in xy: xzy[0].append(x + y) xzy[1].append(x - y) xzy[2].append(-x + y) xzy[3].append(-x - y) anses = [] for z in xzy: anses.append(max(z) - min(z)) print(max(anses))
p02780
s516256394
Accepted
n,k = map(int, input().split()) p = list(map(int, input().split())) from itertools import accumulate cum = [0] + list(accumulate(p)) ans = 0 for i in range(n-k+1): ans = max(ans, cum[i+k]-cum[i]) print((ans+k)/2)
p03380
s911791389
Wrong Answer
n = int(input()) a = sorted(map(int, input().split())) from bisect import bisect_left ans_n = a[-1] p = bisect_left(a, (ans_n+1)//2) ans_r = a[p] if abs(a[p] - ans_n/2) > abs(a[p-1] - ans_n/2): ans_r = a[p-1] print(ans_n, ans_r)
p03827
s911322759
Accepted
n = int(input()) s = input() cnt = 0 max_num = 0 for c in s: if c == 'I': cnt += 1 else: cnt -= 1 if max_num < cnt: max_num = cnt print(max(max_num, 0))
p03605
s522959023
Wrong Answer
N=input() number=0 for a in N: if int(a)==9: print('Yes') else: number+=1 if number==2: print('No')
p02987
s338188199
Wrong Answer
S=input() if S[0]==S[1]: if S[2]==S[3] and S[0]!=S[2]: print("Yes") elif S[0]==S[2]: if S[1]==S[3]: print("Yes") elif S[0]==S[3]: if S[1]==S[2]: print("Yes") else: print("No")
p03076
s032379691
Accepted
a = [int(input()) for _ in range(5)] z,ans = 123,0 for i in a: if i%10!=0:z = min(z,i%10) ans += 10*((i+10-1)//10) print(ans+z-10 if (z!=123) or (z==0) else ans)
p02645
s629801619
Accepted
if __name__ == "__main__": S = input() S = S[:3] print(S)
p02678
s507062874
Wrong Answer
import queue from collections import defaultdict n,m = map(int,input().split()) g = defaultdict(set) ans = [0]*n for _ in range(m): a,b = map(int,input().split()) a -= 1 b -= 1 g[a].add(b) g[b].add(a) visited = [False]*n visited[0] = True q = queue.Queue() q.put(0) while not q.empty(): v = q.get() for p in g[v]: if not visited[p]: ans[p] = v q.put(p) visited[p] = True for x in ans[1:]: print(x+1)
p02814
s096211389
Accepted
from fractions import gcd def lcm(p,q): return p*q//gcd(p,q) n,m = map(int, input().split()) a = list(map(int, input().split())) x = 1 for i in range(n): a[i] = a[i]//2 x = lcm(x,a[i]) for i in range(n): if (x//a[i])%2==0: print(0) exit() p = m//x print(p//2 if p%2==0 else p//2+1)
p03163
s383626195
Accepted
n, W = map(int, input().split()) w, v = [], [] for _ in range(n): a, b = map(int, input().split()) w.append(a) v.append(b) dp = [[0 for _ in range(W+1)] for _ in range(n+1)] for i in range(1, n+1): for j in range(0, W+1): if j - w[i-1] >= 0: dp[i][j] = max(dp[i-1][j], dp[i-1][j-w[i-1]] + v[i-1]) else: dp[i][j] = dp[i-1][j] print(dp[n][W])
p02725
s426083578
Accepted
K, N = map(int, input().split()) A = list(map(int, input().split())) mini = K right = left = K for i in range(N): l_begin = i-1 r_begin = i+1 if i == 0: l_begin = N-1 right = A[l_begin] - A[i] left = K - (A[r_begin]-A[i]) elif i == N-1: r_begin = 0 right = K - (A[i]-A[l_begin]) left = A[i] - A[r_begin] else: right = K - (A[i]-A[l_begin]) left = K - (A[r_begin]-A[i]) local = min(right, left) if local < mini: mini = local print(mini)
p02732
s272665043
Accepted
n = int(input()) a = list(map(int, input().split())) cnt = [0] * n for i in a: cnt[i-1] += 1 total = [0] * n for i in range(n): total[i] = cnt[i] * (cnt[i] - 1) // 2 total_sum = sum(total) for i in a: ans = total_sum ans -= total[i-1] ans += (cnt[i-1] - 1) * (cnt[i-1] - 2) // 2 print(ans)
p03324
s424542857
Accepted
def resolve(): d, n = map(int, input().split()) if n == 100: n = 101 print((100 ** d) * n) resolve()
p02768
s605235758
Accepted
# input n, a, b = map(int, input().split()) mod = 10 ** 9 + 7 al = (pow(2, n, mod) - 1) # 参考:https://qiita.com/MyOden/items/b669bfbf6dbf83242bdf =>フェルマーの小定理を基に演算関数を用意 def fur(n, r): p, q = 1, 1 for i in range(r): p = p * (n - i) % mod q = q * (i + 1) % mod return p * pow(q, mod - 2, mod) % mod nca = fur(n, a) ncb = fur(n, b) ans = (al - nca - ncb) % mod print(ans)
p03486
s588022783
Wrong Answer
import sys s = list(input()) t = list(input()) s.sort() t.sort() for x, y in zip(s, t[::-1]): if x > y: print('No') sys.exit() elif x == y: continue else: print('Yes') sys.exit() if len(s) <= len(t): print('Yes') else: print('No')
p03145
s499980142
Accepted
ab,bc,ca = map(int, input().split()) print(ab*bc//2)
p02778
s949082992
Accepted
def main(): S = input() return 'x' * len(S) if __name__ == '__main__': print(main())
p02995
s002079262
Accepted
import sys from math import gcd read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 MOD = 1000000007 def main(): A, B, C, D = map(int, readline().split()) L = C // gcd(C, D) * D c1, c2 = (A + C - 1) // C, B // C d1, d2 = (A + D - 1) // D, B // D l1, l2 = (A + L - 1) // L, B // L ans = (B - A + 1) - ((c2 - c1 + 1) + (d2 - d1 + 1) - (l2 - l1 + 1)) print(ans) return if __name__ == '__main__': main()
p04031
s088451915
Wrong Answer
n=int(input()) a=list(map(int,input().split())) amin=min(a) amax=max(a) if amin==amax: print(0) exit() c=10000000000 r=0 for x in range(amin,amax+1): i=0 for y in a: i+=(y-x)**2 if c<i: c=i r=x print(x)
p03377
s109054903
Accepted
A, B, X = map(int, input().split()) print('YES' if A <= X <= A + B else 'NO')
p02602
s655897885
Accepted
n,k = map(int , raw_input().split()) ais = map(int, raw_input().split()) for ii in range(k, n): print 'Yes' if ais[ii] > ais[ii - k] else 'No'
p03486
s265915527
Accepted
s = sorted(input()) t = sorted(input(), reverse=True) print("YNeos"[t <= s::2])
p03239
s036388899
Accepted
def main(): line = input() n, T = [int(x) for x in line.split()] lista_tempos = [] lista_custos = [] for i in range(n): line = input() c, t = [int(x) for x in line.split()] if t <= T: lista_tempos.append(t) lista_custos.append(c) if lista_tempos: print(min(lista_custos)) else: print('TLE') main()
p03471
s647640389
Accepted
def main(): N,Y = map(int,input().split()) for i in range(Y//10000+1): for j in range(N-i+1): if Y == i *10000 + j * 5000 + (N-i-j) * 1000: print(*[i,j,N-i-j]) return print(*[-1,-1,-1]) main()
p02861
s097852234
Accepted
N=int(input()) xy=[list(map(int,input().split())) for _ in range(N)] ans=0 for i in range(N): for j in range(i+1,N): d=((xy[i][0]-xy[j][0])**2+(xy[i][1]-xy[j][1])**2)**0.5 ans+=2*d print(ans/N)
p03075
s827016748
Accepted
l = [int(input()) for i in range(5)] k = int(input()) ans = 'Yay!' if l[-1] - l[0] > k: ans = ':(' print(ans)
p02712
s599427435
Wrong Answer
n = int(input()) ans = 0 for i in range(n): if i%3 !=0 and i%5!=0: ans += i print(ans)
p03160
s427330669
Accepted
N = int(input()) H = [int(i) for i in input().split()] dp = [0]*N dp[1] = abs(H[0] - H[1]) if N == 2: print(dp[-1]) else: for i in range(2, N): dp[i] = min(dp[i-2] + abs(H[i]-H[i-2]), dp[i-1] + abs(H[i]-H[i-1])) print(dp[-1])
p02622
s964059151
Accepted
import sys input = lambda: sys.stdin.readline().rstrip() def main(): s = input() t = input() ans = 0 for i in range(len(s)): if s[i] != t[i]: ans += 1 print(ans) if __name__ == '__main__': main()