problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03339
s730668785
Accepted
n = int(input()) s = input() e = s.count("E") w = n - e ans = 10**9 if s[0] == "W": cnt = e else: cnt = e-1 num = cnt #print("Num =",num) for i in range(n-1): if s[i] == s[i+1] and s[i] == "E": cnt -= 1 elif s[i] == s[i+1]: cnt += 1 #print(i,cnt) ans = min(ans,cnt,num) ans = max(ans,0) print(max(ans,0))
p03607
s039699901
Wrong Answer
n=int(input()) d={} for x in range(n): s=int(input()) if s in d: if d[s]==0: d[s]=1 else: d[s]=0 if s not in d: d[s]=1 ans=0 for y in d: if d[y]==1: ans+=1
p02835
s731092800
Wrong Answer
S = sum(list(map(int,input().split()))) if S >= 22: print('burst') elif S <= 21: print('win')
p03721
s961612052
Wrong Answer
def slove(ab_list, k): num_list = [] count = 0 for a, b in ab_list: count += b if count >= k: break return a if __name__ == "__main__": n, k = [int(i) for i in input().split()] ab_list = [[int(i)for i in input().split()] for i in range(n)] print(slove(ab_list, k))
p03852
s991415041
Accepted
if input() in ['a', 'i', 'u', 'e', 'o']: print('vowel') else: print('consonant')
p02690
s977487407
Accepted
X = int(input()) for a in range(-200, 200): for b in range(-200, 200): if a ** 5 - b ** 5 == X: print(a, b) exit()
p02916
s493259647
Wrong Answer
n = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) res = 0 for i in range(n - 1): res += B[i] if A[i] + 1 == A[i + 1]: res += C[A[i] - 1] print(res)
p02646
s157076832
Accepted
a,v=map(int,input().split()) b,w=map(int,input().split()) t=int(input()) d=abs(b-a) dv=v-w if d<=t*dv: print('YES') else: print('NO')
p03543
s351519459
Accepted
n = str(input()) flag = False if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]: flag = True if flag: print('Yes') else: print('No')
p02882
s526045022
Wrong Answer
# D - Water Bottle from math import atan, pi a, b, x = map(int, input().split()) theta = 0 if a * a * b / 2 < x: theta = atan((2 * ((a ** 2) * b - 2)) / (a ** 3)) else: theta = atan((a * (b ** 2)) / (2 * x)) print(theta * 180 / pi)
p03796
s932507232
Accepted
# row = [int(x) for x in input().rstrip().split(" ")] # n = int(input().rstrip()) # s = input().rstrip() # row = [int(input().rstrip()) for _ in range(n)] def resolve(): import sys input = sys.stdin.readline import functools import operator n = int(input().rstrip()) ans = 1 for i in range(1, n+1): ans *= i ans = ans % 1000000007 print(ans) if __name__ == "__main__": resolve()
p02797
s675243187
Accepted
import sys input = sys.stdin.readline n, k, s = [int(x) for x in input().split()] ans = [s]*k add = s + 1 if s + 1 <= 10**9 else s - 1 for i in range(n - len(ans)): ans.append(add) print(*ans)
p03061
s129430231
Accepted
def gcd(a, b): if a < b: return gcd(b, a) while b > 0: a, b = b, a % b return a n = int(input()) a = list(map(int, input().split())) l = a[:] r = a[:] for i in range(n-1): l[i+1] = gcd(l[i], l[i+1]) r[-i-2] = gcd(r[-i-1], r[-i-2]) max_val = max(l[-2], r[1]) for i in range(1, n-1): max_val = max(max_val, gcd(l[i-1], r[i+1])) print(max_val)
p03041
s073865178
Accepted
n, k = map(int, input().split()) s = input() ans = s[:k-1] + chr(ord(s[k-1])+32) + s[k:] print(ans)
p03012
s704652041
Accepted
N = int(input()) W = list(map(int, input().split())) res = [] for i in range (1, N): S1 = sum(W[:i]) S2 = sum(W[i:]) res.append(abs(S1-S2)) print(min(res))
p03106
s072762025
Accepted
a,b,k=map(int,input().split()) i=1 cnt=0 result=[] while i<=min(a,b): if a%i==0 and b%i==0: cnt+=1 result.append(i) i+=1 print(result[-k])
p03038
s756517903
Wrong Answer
N, M = map(int, input().split()) A = sorted(list(map(int, input().split()))) BC = [list(map(int, input().split())) for _ in range(M)] m = A[0] D = [0] for b, c in BC: if c > m: _ = [D.append(c) for i in range(b)] else: continue for i, d in enumerate(D[::-1]): if i == N: break if A[i] < d: A[i] = d else: break print(sum(A))
p02994
s264688128
Wrong Answer
n,a = map(int,input().split()) print(int(a*(n-1)+n/2*(n-1)-1-n))
p02801
s087405785
Accepted
print(chr(ord(input())+1))
p02612
s706933760
Wrong Answer
n = int(input()) while n >= 1000: n -= 1000 n = max(n, 0) # print((1000 - n % 1000) % 1000) print(n)
p03059
s335802102
Accepted
#!/usr/bin/env python3 a, b, t = map(int, input().split()) tmp = a ans = 0 while (True): for i in range(100): if a >= t + 0.5: print(ans) exit() a += tmp ans += b
p03803
s851034860
Wrong Answer
A, B= map(int, input().split()) if A==1: A = 14 if B==1: B=14 if A > B: print("Alice") elif B < A: print("Bob") else : print("Draw")
p03379
s873201349
Accepted
n = int(input()) a = list(map(int, input().split())) b = [] for i in range(len(a)): b.append([a[i], i, 0]) b.sort() for i in range(len(b)): if i < len(b)/2: b[i][2] = b[len(b)//2][0] else: b[i][2] = b[len(b)//2-1][0] b.sort(key=lambda x: x[1]) for i in range(len(b)): print(b[i][2])
p02607
s125142423
Accepted
#!/usr/bin/env python3 import sys input=sys.stdin.readline n=int(input()) arr=list(map(int,input().split())) cnt=0 for i in range(n): if i%2==0 and arr[i]%2==1: cnt+=1 print(cnt)
p02664
s350363751
Wrong Answer
string = input() string=list(string) count = len(string) summary = 0 for i in range(count): if string[i]=="?": string[i]="D" print(string) for i in range(count): if string[i]== "D" and string[i-1]=="P": summary +=1 if string[i] == "D": summary +=1 print(summary)
p03017
s113593470
Wrong Answer
from sys import stdin n,a,b,c,d = [int(x) for x in stdin.readline().rstrip().split()] s = ["#"]+list(stdin.readline().rstrip()) for i in range(b,d-1): if s[i] == "#" and s[i+1] == "#": print("No") exit() s[d] = "#" for j in range(a,c-1): if s[j] == "#" and s[i+1] == "#": print("No") exit() print("Yes")
p02601
s676716711
Accepted
A, B, C = map(int, input().split()) K = int(input()) b = 0 while (b <= K and A >= 2**b * B): b += 1 if 2**b * B < 2**(K-b) * C: print("Yes") else: print("No")
p03852
s319553762
Accepted
c=input() a=["a","i","u","e","o"] if c in a: print("vowel") else: print("consonant")
p03625
s447661699
Accepted
n =int(input()) a = list(map(int,input().split())) a.sort() x,y,i = 0,0,0 while i<n: if a[i-1] == a[i]: x,y = y,a[i] i += 1 i += 1 print(x*y)
p03095
s458525629
Wrong Answer
# -*- coding: utf-8 -*- N = int(input()) S = input() import collections n_frq_dict = collections.defaultdict(int) for s in S: n_frq_dict[s] += 1 ret = 1 for frq in n_frq_dict.values(): ret *= frq + 1 print(ret - 1)
p03720
s386043261
Accepted
def main(): N, M = map(int, input().split()) bridge_count = [0] * N for _ in range(M): a, b = map(int, input().split()) a -= 1; b -= 1 bridge_count[a] += 1 bridge_count[b] += 1 for i in range(N): print(bridge_count[i]) if __name__ == "__main__": main()
p02646
s255442456
Wrong Answer
a, v = list(map(int, input().split())) b, w = list(map(int, input().split())) t = int(input()) if v <= w: print('NO') exit() if abs(a - b) / (w - v) <= t: print('YES') else: print('NO')
p02917
s082137453
Accepted
n = int(input()) blist=list(map(int,input().split())) alist=[] alist.append(blist[0]) for i in range(1,n-1): alist.append(min(blist[i-1],blist[i])) alist.append(blist[n-2]) print(sum(alist))
p03243
s674062699
Accepted
N=int(input()) for i in range(1,10): if 111*i>=N: print(111*i) break
p03043
s396253204
Wrong Answer
N,K=map(int,input().split()) C=[] c=1 while c<K: c*=2 C.append(c) C.reverse() ans=0 h=min(N,len(C)) for i in range(h): ans+=1/(C[i]) d=N-len(C) if d>0: ans+=d print(ans/N)
p02882
s197084267
Accepted
import math a, b, x = map(int, input().split()) men = x / a if a * b / 2 <= men: h = (((a * b) - men) * 2) / a theta = math.degrees(math.atan(h/a)) print(theta) exit() a_dash = men * 2 / b theta = math.degrees(math.atan(a_dash / b)) print(90 - theta)
p02582
s916151521
Accepted
str = input() if str == "RRR": print("3") elif str == "RRS" or str == "SRR": print("2") elif str == "SSS": print("0") else: print("1")
p02576
s533495314
Wrong Answer
nums = input().split() s = int(nums[0])/int(nums[1]) v = int(nums[0])/int(nums[1]) if v != 0: s = int(s)+1 time = s*int(nums[2]) print(time)
p02910
s259234876
Accepted
S = input() n = len(S) NG = 0 for i in range(n): tmp = S[i] if (tmp == "U" or tmp == "D"): pass else: if(i % 2 == 0): if(tmp == "R"): pass else: NG += 1 else: if(tmp == "L"): pass else: NG += 1 if (NG == 0): print("Yes") else: print("No")
p02687
s366306766
Accepted
[print("ABC") if input() == "ARC" else print("ARC")]
p02802
s574710530
Accepted
# ABC 151C n, m = map(int, input().split()) ac = 0 wa = 0 cnt = [0]*n for i in range(m): p, s = input().split() p = int(p) p -= 1 if cnt[p] == -1: continue elif s == 'AC': ac += 1 wa += cnt[p] cnt[p] = -1 else: cnt[p] += 1 print(ac, wa)
p02642
s656219306
Accepted
n = int(input()) a = list(map(int, input().split())) xs = [0] * (max(a) + 1) for v in a: if xs[v] == 0: for j in range(v, len(xs), v): xs[j] += 1 else: xs[v] += 1 print(len(list(filter(lambda v: xs[v] == 1, a))))
p02988
s224422390
Accepted
n=int(input()) p=[int(i) for i in input().split()] cnt=0 for i in range(1,n-1): if p[i-1]<p[i] and p[i]<p[i+1]: cnt+=1 elif p[i-1]>p[i] and p[i]>p[i+1]: cnt+=1 print(cnt)
p03778
s575757366
Accepted
w,a,b=map(int,input().split()) if a+w<b: print(max(b-a-w,0)) else: print(max(0,a-b-w))
p03814
s458793651
Wrong Answer
s=list(input()) l,r=0,len(s) for i in range(len(s)): if i=='A':l=i;break for i in range(len(s)): if len(s)-(i+1)=='Z':r=i;break print(abs(l-r))
p02952
s576219832
Wrong Answer
a = int(input()) count = 0 for i in range(a): if len(str(i)) % 2 == 1: count += 1 print(count - 1)
p03705
s513783375
Wrong Answer
N, A, B = map(int, input().split()) mn = A * (N - 1) + B mx = B * (N - 1) + A print(mx - mn + 1)
p03359
s703852671
Wrong Answer
a, b = map(int, input().split()) if a < b: print(a) else: print(a - 1)
p03251
s765162493
Wrong Answer
N, M, X, Y = list(map(int, input().split())) x = list(map(int, input().split())) + [X, ] y = list(map(int, input().split())) if max(x) < min(y): print('No War') else: print('War')
p02727
s122022483
Wrong Answer
x,y,a,b,c=map(int,input().split()) lia=list(map(int,input().split())) lib=list(map(int,input().split())) lic=list(map(int,input().split())) lia.sort(reverse=True) lib.sort(reverse=True) lic.sort(reverse=True) ans=lia[:x]+lib[:y] ans.sort(reverse=True) cnt=0 now=0 while cnt < x+y and now < c: if lic[now] > ans[cnt]: ans[cnt]=lic[now] now+=1 cnt+=1 print(sum(ans))
p02705
s861975944
Accepted
import math r = int(input()) print(2*r*math.pi)
p03730
s612558066
Wrong Answer
a,b,c=map(int,input().split()) x = a%b if a>b else a f = False for i in range(1,b): if x*i == c: f = True print("Yes" if f is True else "No")
p02627
s045010052
Wrong Answer
if input().isupper: print("A") else: print("a")
p03815
s614064090
Accepted
N=int(input()) k=N//11 s=N-(k*11) if s==0: print(k*2) elif s<=6: print(2*k+1) else: print(2*k+2)
p03252
s598062209
Accepted
S = list(input()) T = list(input()) N = len(S) a = ord('a') alf = [] for i in range(26): alf.append(chr(a)) a += 1 SN = [[] for i in range(26)] TN = [[] for i in range(26)] for i in range(N): for j in range(26): if alf[j] == S[i]: SN[j].append(i) if alf[j] == T[i]: TN[j].append(i) SN.sort() TN.sort() print('Yes' if SN == TN else 'No')
p03711
s699619598
Wrong Answer
import sys x,y = map(int,input().split()) if x <= 0 or x >= 13 or y <= 0 or y >= 13: sys.exit() if x >= y: sys.exit() A = (1, 3, 5, 7, 10, 12) B = (4, 6, 9, 11) if x == 2 or y == 2: print("No") sys.exit() if x in A and y in A: print("Yes") sys.exit() if x in B and y in B: print("Yes") sys.exit()
p03379
s208676460
Wrong Answer
n = int(input()) x = list(map(int,input().split())) y = sorted(x) a = y[n//2] b = y[(n//2)-1] for i in range(n): if x[i]==a: print(b) else: print(a)
p03163
s595175343
Wrong Answer
n, w = map(int, input().split()) wv = [tuple(map(int, input().split())) for _ in range(n)] dp = [0] * (w+1) for wi, vi in wv: for sum_w in reversed(range(w)): dp[sum_w] = max(dp[sum_w], dp[sum_w - wi] + vi) print(dp[w])
p02772
s286770740
Wrong Answer
import sys N = int(input()) p = 'DENIED' for i in map(int, input().split()): print(i) if i % 2 == 0: if i % 3 != 0 and i % 5 != 0: print('DENIED') sys.exit() elif i % 3 == 0 or i % 5 == 0: p = 'APPROVED' print(p)
p03994
s175330855
Accepted
S = input() K = int(input()) ans = "" for s in S: if s == "a": ans += s elif 123-ord(s) <= K: ans += "a" K -= 123-ord(s) else: ans += s if K > 0: ans = ans[:-1] + chr((ord(ans[-1])-97+K)%26+97) print(ans)
p02882
s340703647
Accepted
from math import atan,pi a,b,x=map(int,input().split()) if a*a*b/2<=x: h=x/(a**2) c=(b-h)*2 theta=atan(c/a)/2/pi*360 print(theta) else: c=2*x/b/a theta=atan(b/c)/2/pi*360 print(theta)
p03013
s450275085
Wrong Answer
N, M = (int(x) for x in input().split()) A = [-1]*(N+1) for i in range(M): a = int(input()) A[a] = 0 A[N] = 1 A[N-1] = 1 for i in reversed(range(N-1)): # print("i",i) if A[i] == -1: A[i] = A[i+1] + A[i+2] # print("A[i]",A[i]) print(A[0]%(1000000007))
p02823
s118609744
Wrong Answer
N,A,B = map(int, input().split()) if (B-A)%2==0: print((B-A)//2) else: print(max(B-1, N-A))
p03241
s301619906
Wrong Answer
N, M = map(int, input().split()) if N == 1: print(M) exit() ans = 1 for i in range(2, N + 1): work1 = i * (N - 1) work2 = M - work1 if work2 >= 0 and work2 % i == 0: ans = i print(ans)
p02732
s891071424
Wrong Answer
from collections import Counter N = int(input()) A = list(map(int,input().split())) def ch_2(n): return n*(n-1)//2 count=Counter(A) ans=0 for i in range(len(count)): ans+=ch_2(count[A[i]]) print(ans) for j in range(N): ttl=ans ttl-=ch_2(count[A[j]]) ttl+=ch_2(count[A[j]]-1) print(int(ttl))
p02791
s999712367
Accepted
#problem-c n = int(input()) p = list(map(int, input().split())) cnt = 0 min_p = p[0] for i in range(n): if p[i]<=min_p: cnt += 1 min_p = p[i] print(cnt)
p02615
s056949562
Wrong Answer
import itertools import copy from collections import deque import heapq n = int(input()) a = list(map(int,input().split())) flag = True check = min(a) ans = 0 for i in a: if flag and i == check: flag = False else: ans += i print(ans)
p02601
s323258843
Wrong Answer
A, B, C = list(map(int,input().split())) K = int(input()) for i in range(K): if A < B < C: print("Yes") exit() elif C < B or C < A: C *= 2 continue elif B < A: B *= 2 continue if A < B < C: print("Yes") exit() else: print("No")
p02622
s440868327
Accepted
S = input() T = input() count = 0 for i in range(len(S)): if S[i] != T[i]: count+=1 print(count)
p02947
s149371971
Accepted
N = int(input()) S = [] for i in range(N): S.append(''.join(sorted(list(input())))) S.sort() #print('S', S) count=0 n=1 for i in range(1,N): if S[i-1] == S[i]: n+=1 else: count+= n*(n-1)*0.5 n=1 count+=n*(n-1)*0.5 print(int(count))
p02720
s259829574
Accepted
from heapq import heappush, heappop K = int(input()) hq = [] for i in range(1,10): heappush(hq,i) cnt = 0 while(cnt < K): x = heappop(hq) cnt += 1 for i in [-1,0,1]: d = (x%10)+i if 0 <= d <= 9: heappush(hq,x*10+d) print(x)
p03862
s066910938
Accepted
n,x=map(int,input().split()) a=list(map(int,input().split())) ans=[0]*n if a[0]>x: ans[0]=x else: ans[0]=a[0] for i in range(1,n): ans[i]=min(a[i],x-ans[i-1]) print(sum(a)-sum(ans))
p03095
s415273472
Wrong Answer
n=int(input()) s=input() # 数値(1〜26)→アルファベット(a〜z) n2a = lambda c: chr(c+64).lower() al=[] for i in range(1,27): c=s.count(n2a(i)) if c!=0: al.append(c) base=2**len(al) ans=base-1 for i in range(len(al)): if al[i]==1: continue a=base//2 ans+=a ans%=10**9+7 print(ans)
p02618
s760035705
Accepted
t=1 for i in range(365): print(t) if t == 26: t = 1 else: t +=1
p03759
s377830726
Accepted
a, b, c = map(int, input().split()) if (b-a==c-b): print('YES') else: print('NO')
p03815
s402424045
Wrong Answer
a=int(input()) n=2*a//11+a%11//7+min(0,a%11) print(n)
p02556
s762024630
Accepted
if __name__ == '__main__': N = int(input()) x = [] y = [] for _ in range(N): x_, y_ = map(int, input().split()) x.append(x_) y.append(y_) xpy = [a + b for a, b in zip(x, y)] xmy = [a - b for a, b in zip(x, y)] max_1 = max(xpy) min_1 = min(xpy) max_2 = max(xmy) min_2 = min(xmy) print(max(max_1 - min_1,max_2 - min_2))
p02713
s258937570
Accepted
def resolve(): import math k = int(input()) ans = 0 for i in range(1, k+1): for j in range(1, k+1): gcd1 = math.gcd(i,j) for l in range(1, k+1): gcd = math.gcd(l, gcd1) ans += gcd print(ans) resolve()
p03042
s098347605
Accepted
S = input() f, l = S[:2], S[2:] if 1 <= int(f) <= 12 and 1 <= int(l) <= 12: print('AMBIGUOUS') elif 1 <= int(f) <= 12: print('MMYY') elif 1 <= int(l) <= 12: print('YYMM') else: print('NA')
p03565
s075323344
Accepted
S,T=input(),input() s,t=len(S),len(T) for i in range(s-t+1): if all(c in "?"+d for c,d in zip(S[-i-t:],T)): S=S.replace("?","a") print(S[:-i-t]+T+S[s-i:]) quit() print("UNRESTORABLE")
p02618
s508835049
Accepted
d=int(input()) c=list(map(int,input().split())) ss=[list(map(int,input().split())) for i in range(d)] for i in range(d): print(i%26+1)
p03767
s229315021
Wrong Answer
n = int(input()) a = sorted(list(map(int, input().split())), reverse=True) x = len(a) // n l = [] for i in range(n): for j in range(x): l.append(a[i::x-1]) ans = 0 for i in range(n): ans += l[i][1] print(ans)
p03672
s285425905
Wrong Answer
import sys S = str(input()) if len(S) < 2 or len(S) > 200: sys.exit() if not S.islower(): sys.exit() for I in range(len(S)): length = len(S) - I if (not I == 0)and length % 2 == 0 and S[0:int(length / 2)] == S[int(length / 2):length]: print(length)
p02880
s482949081
Accepted
n = int(input()) flag = False for i in range(1,10): if n%i == 0 and 0 < n/i < 10: flag = True break if flag: print("Yes") else: print("No")
p03309
s331065918
Accepted
import math N = int(input()) li = list(map(int, input().split())) lis = [] for index, i in enumerate(li): lis.append(i - (index + 1)) lis.sort() x = lis[math.floor(N/2)] ans = 0 for i in lis: ans += max(x - i, -x + i) print(ans)
p02860
s537824306
Accepted
n=int(input())//2 S=input() print('Yes'if S[:n]==S[n:]else'No')
p02951
s032322967
Accepted
#136_A a,b,c=map(int,input().split()) print(max(0,c-(a-b)))
p03659
s158823029
Accepted
n = int(input()) lst1 = list(map(int,input().split())) s = sum(lst1) abs_ = 10**18 now = 0 i = 0 while True: now += lst1[i] if i >= n-1: break else: abs_ = min(abs_,abs(now-(s-now))) i += 1 print(abs_)
p03481
s769316830
Accepted
X,Y = map(int,input().split()) tmp = X ans = [X] for i in range(int(1e5)): tmp *= 2 if tmp > Y: break ans.append(tmp) print(len(ans))
p03073
s740498043
Accepted
# -*- coding: utf-8 -*- """ Created on Fri Sep 11 01:37:10 2020 @author: liang """ S = input() N = len(S) ans = 0 for i in range(N): if i%2 == 0 and S[i] == "0": ans += 1 if i%2 == 1 and S[i] == "1": ans += 1 ans = min(ans, N - ans) print(ans)
p02718
s892171503
Wrong Answer
N, M = map(int, input().split()) A = list(map(int, input().split())) count = 0 allpoint = 0 for i in A: allpoint += i for i in A: if i >= (allpoint * (1 // (4 * M))): count += 1 if M > 0 and count >= M: print('Yes') else: print('No')
p02747
s805798281
Wrong Answer
S=list(input()) tmp="" ans="No" for s in S: if(tmp==""): tmp=s else: if(s=='i' and tmp=='h'): ans="Yes" tmp='' else: ans="No" break print(ans)
p03427
s622617885
Wrong Answer
X = list(map(int,input())) print(X) sn = [] for i in range(len(X)): sn.append(sum(X[0:i+1])) ssn = [] for i in range(len(X)): ssn.append(sn[i]-1 + 9*(len(X)-1-i)) print(max(ssn))
p03695
s717106375
Accepted
n = int(input()) a = list(map(int, input().split())) c = [0] * 9 for i in a: if i < 3200: c[i // 400] += 1 else: c[8] += 1 ans = 0 for i in range(8): if c[i] != 0: ans += 1 if ans == 0: print(1, c[8]) else: print(ans, ans + c[8])
p03607
s664446376
Accepted
n=int(input()) a=[int(input()) for i in range(n)] dic={} for i in range(n): if a[i] not in dic: dic[a[i]]=1 else: dic[a[i]]+=1 ans=0 for val in dic.values(): if val%2==1: ans+=1 print(ans)
p02771
s206325831
Accepted
a,b,c=[int(x) for x in input().split()] if a==b and b!=c: print("Yes") elif b==c and a!=b: print("Yes") elif a==c and a!=b: print("Yes") else: print("No")
p02706
s467847403
Wrong Answer
n, m= map(int,input().split()) lista=list(map(int, input().split())) eq= 0 eq2= 0 for i in range(m): eq+= lista[i] eq2= n-eq if eq2==0: print("0") elif eq<0: print("-1") else: print(eq2)
p02754
s940073910
Accepted
N, A, B = map(int, input().split()) print(A*(N//(A+B)) + min(A, N%(A+B)))
p02608
s255969840
Wrong Answer
n = int(input()) count =[0] * n for f in range(1,n+1): for x in range(1, f//5): for y in range(1, f//5): for z in range(1, f//5): if(x*x+y*y+z*z+x*y+y*z+z*x == f): count[f-1]+=1 for i in range(n): print(count[i])
p03351
s463120967
Accepted
a, b, c, d = map(int, input().split()) if (abs(a - b) <= d and abs(b - c) <= d) or abs(a - c) <= d: print("Yes") else: print("No")