problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03478
s469026528
Accepted
n,a,b = map(int,input().split()) sum1 = 0 for i in range(1,n+1): sum = 0 N = list(str(i)) for j in N: sum += int(j) if a<=sum <= b: sum1 += i print(sum1)
p02946
s038586485
Wrong Answer
import sys input = sys.stdin.readline def main(): K, X = map(int, input().split()) LOWER = max(X - K + 1, -1000000) UPPER = min(X + K - 1, 1000000) print(LOWER) ans = [i for i in range(LOWER, UPPER+1)] print(ans) if __name__ == '__main__': main()
p02862
s670991826
Wrong Answer
X, Y = map(int,input().split()) MOD = 10 ** 9 + 7 def calc_comb(n, k, mod): ''' n が大きい場合に使う ''' a = 1 b = 1 for i in range(1,k+1): a *= i a %= mod b *= n n -= 1 b %= mod return b * pow(a, mod-2, mod) % mod if (X+Y) % 3 != 0: print(0) else: n = (2 * X - Y) // 3 m = Y - 2 * n print(calc_comb(n+m,m, MOD))
p02773
s850528442
Wrong Answer
import collections N = int(input()) S = [input() for i in range(N)] c = collections.Counter(S) l = c.most_common() n, m = l[0] ans = [] for i, j in l: if j == m: ans.append(i) print(ans.sort())
p03163
s339688462
Accepted
import sys sys.setrecursionlimit(10**8) input = sys.stdin.readline def resolve(): return N,W = map(int,input().split()) wv = [list(map(int,input().split())) for _ in range (N)] dp = [[0]*(W+1) for _ in range(N+1)] for i in range(N): for j in range(W+1): if j>=wv[i][0]: dp[i+1][j] = max(dp[i][j], dp[i][j-wv[i][0]] + wv[i][1]) else: dp[i+1][j] = max(dp[i][j], dp[i+1][j]) print(dp[N][W])
p02713
s887154399
Accepted
import math N = int(input()) def gcdtriple(a,b,c): return math.gcd(a, math.gcd(b,c)) ans = 0 for a in range(1, N+1): for b in range(1, a+1): for c in range(1, b+1): if a == b and b == c: ans += gcdtriple(a,b,c) elif a == b or b == c or c == a: ans += gcdtriple(a,b,c) * 3 else: ans += gcdtriple(a,b,c) * 6 print(ans)
p03951
s515040987
Wrong Answer
#26 A - Prefix and Suffix N = int(input()) s = list(input()) t = list(input()) s_rev = list(reversed(s)) cnt = N for i in range(1,N+1): # s の部分文字列を後ろから取り出す tgt = list(reversed(s_rev[:i])) if tgt == t[:i]: cnt -= 1 else: break if s == t: print(N) else: ans = s[:cnt] + t print(len(ans))
p03469
s753290467
Wrong Answer
print('2018' + input()[:4])
p02601
s147838247
Accepted
a,b,c=map(int,input().split()) k=int(input()) b_list=[] c_list=[] for i in range(k+1): b_list.append(b*(2**i)) c_list.append(c*(2**i)) for j in range(k): if b_list[j]>a and c_list[k-j]>b_list[j]: print('Yes') break else: print('No')
p03785
s041434610
Accepted
N, C, K = map(int, input().split()) T = [] for _ in range(N): x = int(input()) T.append(x) T.sort() lim = 0 tim = 0 ans = 0 for i in range(N): if lim == 0: lim += 1 tim = T[i] else: if tim + K >= T[i] and lim < C: lim += 1 else: lim = 1 tim = T[i] ans += 1 print(ans+1)
p03261
s280968870
Accepted
n=int(input()) w=[input() for _ in range(n)] for i in range(n-1): if w[i][-1] != w[i+1][0]: print('No') exit(0) else: pass if len(set(w)) == len(w): print('Yes') else: print('No')
p04045
s953570071
Wrong Answer
n,k = map(int,input().split()) d = list(map(str, input().split())) for i in range(n,10001): for j in d: if j in str(i): break else: print (i) exit ()
p03380
s325578932
Accepted
n = int(input()) a_list = list(map(int, input().split())) a_list.sort() a_max = a_list[n - 1] temp_max = [1, 0] bunbo = 1 bunshi = 1 center = int((a_max + 1) / 2) a_set = set(a_list) diff_min = a_max ans = 0 for a in a_set: diff = abs(a-center) if diff_min > diff: diff_min = diff ans = a print(a_max, ans)
p02993
s200307069
Accepted
a,b,c,d = input() if (a==b)or(b==c)or(c==d): print("Bad") else : print("Good")
p02622
s444624413
Wrong Answer
first_string = "abcde" second_string = "abcfd" count = 0 for x, y in zip(first_string, range(len(first_string))): if(second_string[y] != x): count += 1 print(count)
p02657
s304856529
Accepted
a, b = map(int, input().split()) print(a*b)
p03680
s559205616
Accepted
N=int(input()) a = [] for i in range(N): a.append(int(input())) # a=[0]*N # for i in range(N): # a[i]=int(input()) count=0 #loopの定義→同じインデックスを使用したらloop判定 #in の処理を爆速で実行するためにsetを使用する #loop=[] loop=set() tmp=1 while True: tmp=a[tmp-1] count+=1 if tmp==2: print(count) exit() if tmp-1 in loop: print(-1) exit() #loop.append(tmp-1) loop.add(tmp-1)
p03556
s894965770
Accepted
n = int(input()) square = [i ** 2 for i in range(1, int(n**0.5)+1)] print(max(square))
p03433
s450748105
Accepted
N,A = map(int, open(0).read().split()) print('Yes' if N % 500 <= A else 'No')
p03145
s717829509
Accepted
a,b,c = sorted(map(int,input().split())) print(int(1/2*a*b))
p02702
s849709398
Wrong Answer
P=2019 S = input() N=len(S) ans = 0 count = [0] * P count[0] = 1 u = 0 for i, s in enumerate(reversed(S)): print(i,s) u = (int(s) * pow(10, i, P) + u) % P ans += count[u] count[u] += 1 print(ans)
p02935
s976753007
Accepted
N = int(input()) v = list(map(int,input().split())) v1 = v.sort() ans=v[0] for i in v[1:]: ans=(ans+i)/2 print(ans)
p02759
s053309575
Accepted
#k = int(input()) #s = input() #a, b = map(int, input().split()) #l = list(map(int, input().split())) n = int(input()) if (n % 2 != 0): print (n//2+1) else: print(n//2)
p02881
s793435193
Accepted
def resolve(): n = int(input()) xdiv = int(n**0.5) for i in range(xdiv, 0, -1): if n % i ==0: dest = i + n//i print(dest-2) exit() resolve()
p02953
s364813951
Accepted
N = int(input()) H = list(map(int, input().split())) ans = "Yes" for i in range(N-1): if H[i] < H[i+1]: H[i+1] = H[i+1]-1 if H[i] > H[i+1]: ans = "No" break print(ans)
p03455
s661350285
Accepted
a, b = map(int, input().split()) if a * b % 2 == 0: print('Even') else : print('Odd')
p03672
s157946404
Wrong Answer
import sys S=input() for i in range(1,len(S)): S=S[:-1] if len(S)%2==0: c=len(S) print(S[c//2+1:]) print(S[:c//2]) if S[:c//2]==S[c//2+1:]: print(i) sys.exit()
p02859
s177401789
Accepted
r = int(input()) r = r**2 print(r)
p02797
s088393437
Accepted
n, k, s = map(int, input().split()) A = [s]*k if s == pow(10, 9): A += [1]*(n-k) else: A += [s+1]*(n-k) print(*A)
p03043
s604006044
Wrong Answer
N,K = map(int,input().split()) tmp = 1 num_cnt = 0 while K > tmp : tmp *= 2 num_cnt +=1 nums_list = [] for i in range(1,N+1): for j in range(num_cnt+1): if i*(2**j) > K: nums_list.append((1/2)**j) break print(sum(nums_list)*(1/N))
p02833
s683511034
Accepted
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 MOD = 1000000007 def main(): N = int(readline()) if N % 2: print(0) return ans = N // 10 p = 50 while True: tmp = N // p if tmp == 0: break ans += tmp p *= 5 print(ans) return if __name__ == '__main__': main()
p02882
s128515541
Wrong Answer
a,b,x = map(int,input().split()) import math if a**2*b / 2 < x: alpha = math.degrees(math.atan(2 * (a**2 * b - x) / a**3)) else: alpha = math.degrees(math.atan((a*b**2)/2*x )) print(alpha)
p03854
s150618051
Wrong Answer
s = input() s = s.replace("eraser", "X") s = s.replace("dreamer", "X") s = s.replace("erase", "X") s = s.replace("dream", "X") count = s.count("X") if len(s) == count: print("Yes") else: print("No")
p03001
s205387984
Accepted
w, h, x, y = map(int, input().split()) s = w * h / 2 if x * 2 == w and y * 2 == h: print(s, 1) else: print(s, 0)
p03293
s469189565
Accepted
import queue s = str(input()) t = str(input()) for i in range(int(len(s))): if s == t: print("Yes") exit() else: tmp = s[0] s = s[1:] s = s + tmp print("No")
p03150
s017676278
Wrong Answer
s=input() t="keyence" ans=False for i in range(len(t)): a=t[:i] b=t[i:] if s.find(a)==0 and s.find(b)!=-1: ans = True break if ans is True: print("YES") else: print("NO")
p02987
s070605706
Wrong Answer
s=list(input()) s.sort() if s[0]==s[1] and s[2]==s[3]: print("Yes") else: print("No")
p02780
s164452342
Accepted
N, K = map(int, input().split()) A = list(map(int, input().split())) hoge=0 for i in range(K): hoge += A[i] re=hoge for i in range(N-K): hoge=hoge+A[K+i]-A[i] if hoge >= re: re=hoge print((re+K)/2)
p02779
s156234997
Accepted
n = int(input()) a = list(map(int,input().split())) if n == len(set(a)): print('YES') else: print('NO')
p03455
s234011621
Accepted
b, c = map(int, input().split()) if b * c % 2 == 1: print("Odd") else: print("Even")
p02796
s061864182
Accepted
n = int(input()) x = [] for i in range(n): X,L = map(int, input().split()) x.append([X-L,X+L]) x.sort(key=lambda x:x[0]) ans = n tmp = x[0][1] for i in range(1,n): if tmp>x[i][0]: ans -=1 tmp = min(tmp,x[i][1]) else: tmp = x[i][1] print(ans)
p03472
s235099872
Accepted
n,h = map(int,input().split()) ab = [list(map(int,input().split())) for _ in range(n)] maxa = 0 for a,b in ab: maxa = max(maxa,a) ab.sort(key = lambda x: x[1], reverse = True) ans = 0 for a,b in ab: if h <= 0: break else: if maxa > b: break else: h -= b ans += 1 if h > 0: ans += -(-h // maxa) print(ans)
p02918
s012896478
Wrong Answer
import sys sys.setrecursionlimit(10 ** 7) read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # WA N, K = map(int, input().split()) S = list(input()) START = S[0] prev = S[0] ans = 0 for i in range(1, N): s = S[i] if prev == s: ans += 1 else: if s == START and K > 0: ans += 2 if i < N else 1 K -= 1 prev = s print(ans)
p03475
s665661982
Wrong Answer
N = int(input()) A = [0 for _ in range(N)] for i in range(N-1): c, s, f = map(int, input().split()) for j in range(i+1): if A[j] < s: A[j] = s + c else: d = - (s - A[j]) // f + 1 A[j] = s + f * d + c print(A) for i in range(N): print(A[i])
p02959
s951203121
Accepted
n = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) ans = 0 for i in range(n): x = min(a[i],b[i]) b[i] -= x ans += x y = min(a[i+1],b[i]) ans += y a[i+1] -= y print(ans)
p03455
s779867462
Accepted
a,b = map(int,input().split()) if a*b % 2 == 0: print('Even') else: print('Odd')
p03493
s699742601
Accepted
print(input().count('1'))
p03103
s651640601
Accepted
N, M = map(int, input().split()) X = [list(map(int, input().split())) for _ in range(N)] X.sort() res = M ans = 0 for a, b in X: if res <= 0: break tmp = min(b, res) res -= tmp ans += tmp * a print(ans)
p02756
s553845593
Accepted
from collections import deque s = input() q = int(input()) revflag = 1 d = deque(s) for i in range(q): tfc = list(map(str, input().split())) if tfc[0] == '1': revflag *= -1 elif tfc[1] == '1': if revflag > 0: d.appendleft(tfc[2]) else: d.append(tfc[2]) else: if revflag > 0: d.append(tfc[2]) else: d.appendleft(tfc[2]) if revflag > 0: print(''.join(d)) else: print(''.join(reversed(d)))
p02775
s790943830
Accepted
n = input() N = [] ans = 0 l = len(str(n)) for i in range(l): N.append(int(n[-i-1])) N.append(0) for i in range(l+1): if N[i]<5: ans += N[i] elif N[i]>5: ans += 10-N[i] N[i+1] += 1 elif N[i+1]>4: ans += 10-N[i] N[i+1] += 1 else: ans += N[i] print(ans)
p03910
s298068365
Accepted
N = int(input()) import math ans = [] def calc(N): ans_q = math.ceil((2*N+1/4)**(1/2)-1/2) ans.append(ans_q) return N-ans_q while N != 0: N = calc(N) [print(x) for x in sorted(ans)]
p04030
s695177800
Accepted
s = input() ans = "" for i in range(len(s)): if s[i] == "0": ans += "0" elif s[i] == "1": ans += "1" else: ans = ans[:-1] print(ans)
p03062
s625604430
Accepted
n = int(input()) A = list(map(int,input().split())) minus = 0 ans = 0 abs_min = float('inf') for a in A: if a < 0: minus += 1 ans += abs(a) abs_min = min(abs_min, abs(a)) if minus%2: ans -= abs_min*2 print(ans)
p02708
s726346527
Accepted
N,K = map(int, input().split()) i = K S = 0 while i < N+1: S = S + (N+1-i)*i+1 i = i + 1 S = S + 1 print(int(S%1000000007))
p02607
s858290435
Accepted
n = int(input()) line = [int(x) for x in input().split()] count = 0 for i in range(0, n, 2): if line[i] % 2 != 0: count += 1 print(count)
p03633
s688334377
Wrong Answer
import fractions n = int(input()) t = [0]*n for i in range(n): t[i] = int(input()) ans = t[0] for i in range(n-1): ans = t[i] * t[i+1] / fractions.gcd(t[i],t[i+1]) print(int(ans))
p03611
s258780986
Accepted
N=int(input()) an=sorted(list(map(int,input().split()))) dic={} for ai in an: if ai not in dic:dic[ai]=1 else:dic[ai]+=1 pass max_v=0 for x in range(an[0],an[-1]+1): v=0 if x-1 in dic: v+=dic[x-1] if x in dic: v+=dic[x] if x+1 in dic: v+=dic[x+1] max_v=max(max_v,v) print(max_v)
p03360
s201880901
Accepted
#template def inputlist(): return [int(j) for j in input().split()] from collections import Counter #template #issueから始める li = inputlist() K = int(input()) li.sort() li[-1] = li[-1]*2**K print(sum(li))
p03623
s541220269
Accepted
x,a,b=map(int,input().split()) print(["A","B"][abs(x-b)<=abs(x-a)])
p03555
s286155384
Wrong Answer
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections s = list(input()) t = list(input()) t2 = "" for i in range(len(t)): t2+=t[len(t)-i-1] if s == t2: print("YES") else: print("NO")
p03854
s883380119
Wrong Answer
c = input().rstrip('\n') str1 = "dreamer" str2 = "dream" str3 = "eraser" str4 = "erase" count = 0 while(count < len(c)-1): if(c[count:count+len(str1)] == str1): count += len(str1) elif(c[count:count+len(str2)] == str2): count += len(str2) elif(c[count:count+len(str3)] == str3): count += len(str3) elif(c[count:count+len(str4)] == str4): count += len(str4) else: print("NO") exit() print("YES")
p02899
s281705606
Accepted
N = int(input()) D = input().split() D = sorted([[int(D[i]),i+1] for i in range(N)]) for i in range(N): print(D[i][1],end = " ")
p02582
s956288616
Accepted
print(len(max(input().split('S'))))
p03352
s406763762
Wrong Answer
X = int(input()) ans = 1 for i in range(2,int(X**0.5)+1): cnt = 2 y = i**cnt while y<X: ans = max(ans,y) cnt +=1 y = y*i print(ans)
p02755
s724311496
Accepted
a, b = map(int,input().split()) if b < 10: for x in range(10*b,10*(b+1)): if int(0.08*x) == a: print(x) exit() else: for x in range(10*b,10*b+10): if int(0.08*x) == a: print(x) exit() print(-1)
p03419
s482457572
Accepted
N,M = map(int,input().split()) if N == 1 and M == 1: print(1) elif N == 1 or M == 1: print(N*M-2) elif 2 <= N*M <= 6: print(0) else: print((N-2)*(M-2))
p03254
s949325774
Wrong Answer
n,x=map(int,input().split()) a=list(map(int,input().split())) a.sort() ans=0 for i in range(n): if a[i]<=x: x=x-a[i] ans=ans+1 if ans>0 and x>0: ans=ans-1 print(ans)
p03146
s417316100
Accepted
s = int(input()) def f(n): a = 0 if n % 2 == 0: a = n // 2 else: a = 3 * n + 1 return a arr = [s] i = 1 flag = 0 while flag == 0: an = f(arr[i - 1]) arr.append(an) for j in range(i): if an == arr[j]: flag = 1 break i += 1 print(len(arr))
p03208
s351911113
Accepted
n,k = map(int,input().split()) h = [int(input()) for _ in range(n)] h.sort() ans = 10**9 for i in range(n-k+1): #print(i,i+k-1) ans = min(ans,h[i+k-1]-h[i]) print(ans)
p02699
s331352590
Accepted
x = input() s = int(x.split()[0]) w = int(x.split()[1]) if w >= s: print("unsafe") else: print("safe")
p03861
s173297645
Accepted
a, b, x = map(int, input().split()) print(b//x-(a-1)//x)
p02693
s121696493
Accepted
n = int(input()) a,b = map(int,input().split()) #a_L = list(map(int,input().split())) for i in range(a,b+1): if i%n == 0: print("OK") exit() print("NG")
p03380
s981767150
Accepted
N = int(input()) a =list(map(int, input().split())) a.sort() ans1 = a[-1] ans2 = 0 for i in a: if abs(ans1/2-ans2) > abs(ans1/2-i): ans2 = i print(ans1, ans2)
p03730
s614640395
Wrong Answer
A, B, C = list(map(int, input().split())) flag = False for i in range(1, B + 1): remainder = A * i % B if remainder == C: flag = True if flag: print("Yes") else: print("No")
p02832
s208374490
Accepted
n=int(input()) a=list(map(int,input().split())) ans=-1 next=1 b=0 for i in range(n): if a[i]==next: next+=1 else: b+=1 print(b if b<n else -1)
p02829
s187995757
Accepted
print(6 - int(input()) - int(input()))
p03478
s121705120
Wrong Answer
n,a,b=map(int,input().split()) ans=0 for i in range(1,n+1): s=str(i) s=sum(list(map(int,s))) if a<=s and s<=b: ans+=1 print(ans)
p03145
s567654707
Accepted
a,b,c = map(int, input().split()) print(int(a*b/2))
p04020
s114050507
Accepted
N = int(input()) A = [int(input()) for _ in range(N)] ans = 0 for i in range(N-1): ans += A[i]//2 A[i] %= 2 if A[i] <= A[i+1]: ans += A[i] A[i+1] -= A[i] ans += A[N-1]//2 print(ans)
p03323
s025016750
Accepted
a,b = map(int, input().split()) if a <= 8 and b <= 8 : print("Yay!") else: print(":(")
p03767
s926183428
Wrong Answer
n = int(input()) a = list(map(int, input().split())) a.sort() for i in range(n): a.pop() a.pop(0) print(sum(a))
p02661
s937912417
Accepted
import statistics N = int(input()) A = [] B = [] for i in range(N): a, b = list(map(int, input().split())) A.append(a) B.append(b) Am = statistics.median(A) Bm = statistics.median(B) if N % 2 == 0: print(round(2 * (Bm - Am) + 1)) else: print(Bm - Am + 1)
p03136
s182180758
Accepted
N=input() sides = [int(i) for i in input().split()] maxSide = max(sides) print('Yes' if maxSide < sum(sides) - maxSide else 'No')
p03264
s417858562
Accepted
#abc108 a k=int(input()) ans=0 for i in range(1,k+1): for j in range(1,k+1): if i%2==0 and j%2==1: ans+=1 print(ans)
p03062
s285400777
Wrong Answer
def resolve(): N = int(input()) A = [int(i) for i in input().split()] for i in range(N - 1): if A[i] < 0: A[i] *= -1 A[i + 1] *= -1 if abs(A[-2]) < abs(A[-1]): A[-2] *= -1 A[-1] *= -1 print(sum(A)) resolve()
p03086
s815190024
Accepted
import sys sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 def input(): return sys.stdin.readline().rstrip() def main(): S=list(input()) ans=0 tmp=0 for s in S: if s=='A' or s=='T' or s=='G' or s=='C': tmp+=1 else: ans=max(ans,tmp) tmp=0 ans=max(ans,tmp) print(ans) if __name__ == '__main__': main()
p02909
s279580875
Wrong Answer
S =str(input()) S.split() kisu = ['R', 'U', 'D'] gusu = ['L', 'U', 'D'] c = 0 for i in range(len(S)): if i%2 == 0: if S[i] in kisu: c += 1 else: if S[i] in gusu: c += 1 if c == len(S): print('Yes') else: print('No')
p03331
s254907093
Accepted
def solve(x): n = len(str(x)) res = 0 for i in str(x): res += int(i) return res n=int(input()) ans = 10**20 for a in range(1,n): ans = min(ans,solve(a)+solve(n-a)) print(ans)
p02690
s336044027
Wrong Answer
import bisect as bs import sys x = int(input()) dic = {} i = 1 while True: dic[i ** 5] = i if i ** 5 >= 10 ** 10: break i += 1 for i in range(100): tmp = x + (i ** 5) if tmp in dic.keys(): print(dic[tmp], i) sys.exit(0) tmp = x - (i ** 5) if tmp in dic.keys(): print(dic[tmp], -i) sys.exit(0)
p03438
s064557222
Accepted
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) sum_a=sum(a) sum_b=sum(b) a_cnt,b_cnt=0,0 for aa,bb in zip(a,b): if aa>bb: a_cnt+=aa-bb elif aa<bb: b_cnt+=(bb-aa)//2 if a_cnt<=b_cnt: print('Yes') else: print('No')
p04005
s048509342
Accepted
A,B,C = map(int,input().split()) #if A%2 == 0 or B%2 == 0 or C%2 == 0 : # print(0) # exit() L = abs(A*B*(C//2) - (A*B*(C-C//2))) N = abs(A*C*(B//2) - (A*C*(B-B//2))) M = abs(C*B*(A//2) - (C*B*(A-A//2))) print(min(L,N,M))
p02831
s016241251
Wrong Answer
num = [int(s) for s in input().split()] com = 1 tes = 2 if max(num)%min(num) == 0: print(max(num)) else: while tes < min(num)/2: if min(num)%tes == 0 and max(num)%tes == 0: com *= tes num = [int(n/tes) for n in num] else: tes += 1 print(com*min(num)*max(num))
p02793
s969852721
Accepted
def gcd(a, b): while b: a, b = b, a % b return a def lcm(a, b): return b//gcd(a, b)*a P = 10**9+7 N = int(input()) A = [int(a) for a in input().split()] L = 1 s = 0 for a in A: L = a // gcd(L, a) * L s += pow(a, P-2, P) print(s * L % P)
p03487
s111142647
Accepted
import collections n=int(input()) a=list(map(int,input().split())) c=collections.Counter(a) cnt=0 for a in c: if c[a]-a>=0: cnt+=min(c[a]-a,c[a]) else: cnt+=c[a] print(cnt)
p03493
s593372581
Accepted
S = input() print(S.count("1"))
p03997
s641293864
Wrong Answer
a = int(input()) b = int(input()) h = int(input()) print(2*(a+b)*h)
p02701
s857974746
Accepted
n = int(input()) A = [] for i in range(n): A.append(input()) A = list(set(A)) print(len(A))
p03433
s919784191
Wrong Answer
n=int(input()) a=int(input()) if a==0: if n%500==0: print("Yes") else: print("No") elif n//500+a>=n: print("Yes") else: print("No")
p02606
s105118667
Accepted
def cin(): return input().split() x = cin() l = int(x[0]) r = int(x[1]) d = int(x[2]) sum = 0; for i in range(l,r+1): if i % d == 0: sum += 1 print(sum)
p03804
s104231844
Accepted
n,m = map(int,input().split()) #要復習 a = [input() for _ in range(n)] b = [input() for _ in range(m)] for i in range(n-m+1): for j in range(n-m+1): a1 = [a[k][j:j+m] for k in range(i,i+m)] if a1 == b: print('Yes') exit() print('No')