problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03767
s650934800
Accepted
n=int(input()) a_list=[int(i) for i in input().split()] a_list.sort(reverse=True) second_list=a_list[1:2*n:2] print(sum(second_list))
p02729
s425857925
Accepted
import math def comb(n,r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) N,M = map(int,input().split()) count = 0 if N <= 1: a = 0 else: a = comb(N,2) if M <= 1: b = 0 else: b = comb(M,2) print(a+b)
p02859
s227346170
Wrong Answer
line = int(input()) print(int((line * line * 3.14) // (1 * 1 * 3.14)))
p03745
s799125906
Accepted
n = int(input()) a = list(map(int, input().split())) judge = 'equal' cnt = 1 for i in range(n-1): if a[i] < a[i+1]: if judge == 'equal': judge = 'high' elif judge == 'low': judge = 'equal' cnt += 1 elif a[i] > a[i+1]: if judge == 'equal': judge = 'low' elif judge == 'high': judge = 'equal' cnt += 1 print(cnt)
p03814
s383995584
Accepted
# -*- coding: utf-8 -*- def main(): s = input() listS = list(s) n = len(listS) aIndex = 0 zIndex = 0 for i in range(n): if listS[i] == 'A': aIndex = i break for i in range(n): if listS[-(i + 1)] == 'Z': zIndex = n - i break ans = zIndex - aIndex print(ans) if __name__ == "__main__": main()
p02995
s173169029
Accepted
from fractions import gcd def lcm(a,b): return a*b//gcd(a,b) a,b,c,d = map(int,input().split()) ans = 0 ans += b // c - (a-1) // c ans += b // d - (a-1) // d l = lcm(c,d) ans -= b // l - (a-1) // l print(b-a+1-ans)
p03208
s706879976
Wrong Answer
n, k = map(int, input().split()) h = [int(input()) for i in range(n)] h.sort() ans = 1000000 for i in range(n-k+1): ans = min(ans, h[i+k-1] - h[i]) print(ans)
p02576
s169589549
Wrong Answer
n, x, t = map(int, input().split()) if n % t == 0: ans = (n // x) * t else: ans = (n // x + 1) * t print(ans)
p03478
s863809019
Wrong Answer
n,a,b = map(int,input().split()) ans = 0 for i in range(1,n+1): d = i s=0 while d: r = d %10 d = int(d/10) s+=r if a<=s<=b: ans += 1 print(ans)
p02717
s384226822
Accepted
x, y, z = map(int, input().split()) print(z,x,y)
p02959
s407494299
Wrong Answer
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) ans=0 for i in range(n): if b[i]-a[i]>=0: ans+=a[i] if (b[i]-a[i])-a[i+1]>=0: ans+=a[i+1] a[i+1]=0 else: ans+=b[i]-a[i] a[i+1]-(b[i]-a[i]) else: ans+=b[i] print(ans)
p03329
s351971783
Accepted
N = int(input()) DP = [10000000]*(2*N+1) DP[0] = 0 for i in range(0, N+1): DP[i+1] = min(DP[i+1],DP[i]+1) s = 6 while s <= N: DP[i + s] = min(DP[i + s],DP[i]+1) s = s*6 n = 9 while n <= N: DP[i + n] = min(DP[i + n],DP[i]+1) n = n*9 print(DP[N])
p02571
s592047571
Accepted
s = input() t = input() ans = float("inf") for i in range(len(s) - len(t) + 1): num = 0 for j in range(len(t)): if s[i + j] == t[j]: continue else: num += 1 ans = min(ans, num) print(ans)
p03605
s884786231
Wrong Answer
N=str(input()) if N[0]==9 or N[1]==9: print('Yes') else: print('NO')
p02854
s602039931
Accepted
n = int(input()) a = list(map(int,input().split())) ruiseki_WA=[0] for i in range(n): ruiseki_WA.append(ruiseki_WA[i]+a[i]) ans=float("inf") for i in range(n): kari=abs(ruiseki_WA[i]-(ruiseki_WA[-1]-ruiseki_WA[i])) ans=min(ans,kari) print(ans)
p02572
s934105839
Accepted
D = 10 ** 9 + 7 N = int(input()) L= list(map(int, input().split())) ans = L[0] * L[1] % D sub = L[0] + L[1] for n in range(2,N): ans += L[n] * sub sub += L[n] print(ans % D)
p02982
s378340435
Wrong Answer
import math def colcu (bli,ali,D): num = 0 for i in range(D): num += (bli[i] - ali[i]) ** 2 return math.sqrt(num) N,D = map(int, input().split()) pli = [] for i in range(N): pli.append(list(map(int, input().split()))) an = 0 for i in range(N-1): for t in range(i+1,N): if colcu(pli[i],pli[t],D).is_integer(): an += 1 print(colcu(pli[i],pli[t],D)) print(an)
p03210
s611532819
Wrong Answer
x=int(input()) if x==7 or x==5 or x==3: print('Yes') else: print('No')
p03043
s987156128
Accepted
import math n,k = map(int, input().split()) p = 0 if (n-(k-1) >= 1): p += (n-(k-1))/n for i in range(1, k): a = math.ceil(math.log2(k/i)) p += (1/n) * ((1/2)**a) else: for i in range(1, n+1): a = math.ceil(math.log2(k/i)) p += (1/n) * ((1/2)**a) print(p)
p02601
s596861171
Accepted
a,b,c = map(int,input().split()) k = int(input()) for l in range(1,k+1): for i in range(l+1): for j in range(l+1-i): for k in range(l+1-i-j): if b*pow(2,j) > a*pow(2,i) and c*pow(2,k) > b*pow(2,j): print('Yes') exit() print('No')
p02796
s196207882
Accepted
import sys input = sys.stdin.readline N = int(input()) XL = [] for _ in range(N): tmp = [int(x) for x in input().split()] XL.append(tmp) LR = [] for i in XL: LR.append([i[0] - i[1], i[0] + i[1]]) LR.sort() ans = N last = LR[0][1] for i in range(1, N): if last > LR[i][0]: if last > LR[i][1]: last = LR[i][1] ans -= 1 else: last = LR[i][1] print(ans)
p02660
s162791953
Wrong Answer
def prime(p): memo = [] for i in range(2,(int(p**0.5)+1)): jousu = 1 while p%(i**jousu)==0: p //= i**jousu memo.append(i**jousu) jousu += 1 if p == n and n != 1: memo.append(p) return memo n=int(input()) memo = prime(n) if len(memo) == 0: print(0) else: print(len(memo))
p02778
s734259167
Accepted
S = input() print("x"*len(S))
p02657
s155395483
Wrong Answer
n, *l = map(int, open(0).read().split()) a = 1 for i in l: a *= i if a > 1e18: a = -1 break print(a)
p03145
s650098231
Wrong Answer
x, y ,z = map(int, input().split()) print(int(0.5*x**y))
p02606
s792317401
Wrong Answer
L, R, d = list(map(int, input().split())) print(R//d - L//d)
p02595
s831564155
Accepted
import math N, D = map(int, input().split()) L = [list(map(int, input().split())) for _ in range(N)] ans = 0 for i in range(N): dist = L[i][0] ** 2 + L[i][1] ** 2 if math.sqrt(dist) <= D: ans += 1 print(ans)
p03293
s243259285
Accepted
s=input() t=input() n=len(s) for i in range(n): if t==s[i:]+s[:i]: print("Yes") exit() print("No")
p03013
s066635078
Wrong Answer
import sys MOD = 10**9 + 7 n, m = map(int, input().split()) a = [int(x) for x in sys.stdin.readlines()] p1, p2 = 0, 0 if 1 not in a: p1, p2 = 0, 1 if 2 not in a and n >=2: p1, p2 = p2, p2 + 1 for i in range(2, n): if i+1 not in a: p1, p2 = p2, (p2 + p1)%MOD else: p1, p2 = p2, 0 print(p2)
p02682
s571882177
Accepted
n_plus, n_zero, n_minus, n_cards = map(int, input().split()) if n_cards <= n_plus: print(min(n_plus, n_cards)) elif n_cards <= (n_plus + n_zero): print(n_plus) else: print(n_plus - (n_cards - n_plus - n_zero))
p02912
s987424518
Accepted
import heapq n, m = map(int, input().split()) a = list(map(lambda x: int(x)*(-1), input().split())) heapq.heapify(a) for _ in range(m): tmp_win = heapq.heappop(a) heapq.heappush(a, (-1)*(-tmp_win//2)) print(-sum(a))
p02613
s876638133
Accepted
N = int(input()) A = 0 W = 0 T = 0 R = 0 for i in range(N): word = input() if ("AC" == word): A += 1 elif ("WA" == word): W += 1 elif ("TLE" == word): T += 1 else: R += 1 print("AC x " + str(A)) print("WA x " + str(W)) print("TLE x " + str(T)) print("RE x " + str(R))
p02917
s784111418
Accepted
N = int(input()) B = [int(i) for i in input().split(' ')] A = [0]*(N) for i,a in enumerate(B): if i == 0: #index最初 A[i] = a A[i+1] = a else:#二番目以降 if B[i-1] < B[i]: A[i+1] = a else: A[i] = a A[i+1] = a print(sum(A))
p03408
s646705108
Wrong Answer
N=int(input()) n=[str(input()) for i in range(N)] M=int(input()) m=[str(input()) for i in range(M)] for i in range(N): print(max(0, n.count(n[i])-m.count(n[i])))
p03210
s149924074
Accepted
import sys cand = [7, 5, 3] x = int(sys.stdin.readline().rstrip()) def main(): return 'YES' if x in cand else 'NO' if __name__ == '__main__': ans = main() print(ans)
p02780
s765615743
Accepted
n,k=map(int,input().split()) p=list(map(int,input().split())) s=[0]*(n+1) for i in range(n): x=p[i] s[i+1]=(x+1)/2+s[i] ans=0 for i in range(k,n+1): ans=max(ans,s[i]-s[i-k]) print(ans)
p02714
s686185890
Wrong Answer
import itertools N = int(input()) S = input() #Rc1,Gc1,Bc1 out = S.count('R') * S.count('G') * S.count('B') print(out) RGBs = list(itertools.permutations(['R', 'G', 'B'], 3)) for i in range(1, N): for j in range(N-i*2): #三つ連続であり、RGBで構成されている if (S[j], S[j+i], S[j+i*2]) in RGBs: out -= 1 print(out)
p02790
s186039269
Accepted
a, b = map(int, input().split()) if a > b: print(str(b)*a) else: print(str(a)*b)
p02570
s803518935
Wrong Answer
d,t,s = map(int,input().split()) if (d / s) <= t: print("yes") else: print("no")
p03478
s973049993
Accepted
a, b, c = map(int, input().split()) sum_out = 0 for i in range(1, a+1): d = str(i) keta = len(d) sum_a = 0 for j in range(keta): sum_a += int(d[j]) if b <= sum_a & sum_a <= c: sum_out += i print(sum_out)
p02689
s520189905
Accepted
N,M = map(int, input().split()) H=list(map(int,input().split())) graph=[[0] for _ in range(N)] for i in range(M): A, B = map(int, input().split()) graph[A-1].append(H[B-1]) graph[B-1].append(H[A-1]) ans=0 for i in range(N): if H[i]>max(graph[i]): ans+=1 print(ans)
p03760
s399405564
Wrong Answer
O = input() E = input() for o, e in zip(O, E): print(o,e, sep='', end='')
p03860
s499907689
Accepted
a,b,c=input().split() print(a[0],b[0],c[0],sep="")
p02959
s572191944
Accepted
n = int(input()) a = [int(e) for e in input().split()] b = [int(e) for e in input().split()] result = 0 for i in range(n): if a[i] > b[i]: result += b[i] b[i] = 0 else: result += a[i] b[i] -= a[i] if a[i + 1] > b[i]: result += b[i] a[i + 1] -= b[i] else: result += a[i + 1] a[i + 1] = 0 print(result)
p02690
s734122400
Accepted
x = int(input()) if x == 2: print(1, -1) exit(0) for d in range(1, int(x ** 0.5) + 1): for w in [-d, -x // d, d, x // d]: for a in range(-1000, 1000): if a ** 5 - (a - w) ** 5 == x: print(a, a - w) exit(0)
p02784
s687615161
Accepted
H,N=map(int,input().split()) a=list(map(int,input().split())) if H>sum(a): print("No") else: print("Yes")
p03163
s940693591
Wrong Answer
import sys input = sys.stdin.readline #文字列入力では注意! N,W = map(int,input().split()) dp = [[0]*(W+1) for _ in range(N+1)] for i in range(N): w,v = map(int,input().split()) for j in range(W+1): if j+w <= W: dp[i+1][j+w] = dp[i][j]+v dp[i+1][j] = max(dp[i+1][j],dp[i][j]) print(dp) print(dp[N][W])
p03665
s650927646
Accepted
n, p, *a = map(int, open(0).read().split()) print([[2**n, 0][p], 2**~-n][sum(i%2 for i in a)>0])
p02720
s556501497
Accepted
from collections import deque k = int(input()) def generate_lunlun(x): d = int(x) % 10 if d != 0: yield x+str(d-1) yield x+str(d) if d != 9: yield x+str(d+1) d = deque([str(i) for i in range(1, 10)]) for _ in range(k): x = d.popleft() for y in generate_lunlun(x): d.append(y) print(x)
p02963
s312776118
Wrong Answer
S = int(input()) if S <= 10**9: ans = [0, 0, S, 0, 0, 1] print(*ans) exit() else: mod = S % (10 ** 9) syou = S // (10 ** 9) ans = [0, 0, 10 ** 9, 1, mod, syou] print(*ans)
p02866
s694950611
Accepted
from sys import exit N = int(input()) D = list(map(int, input().split())) if D[0] != 0: print(0) exit() c = {} for i in D: if i in c: c[i] += 1 else: c[i] = 1 if c[0] != 1: print(0) exit() result = 1 for i in range(1, max(D) + 1): if i not in c: print(0) exit() result = result * (c[i - 1] ** c[i]) % 998244353 print(result)
p03427
s174578715
Accepted
n = input() if n[1:] == "9" * (len(n) - 1) : num = (int(n[0])) + 9 * (len(n) - 1) else: num = (int(n[0]) - 1) + 9 * (len(n) - 1) print(num)
p02621
s793818191
Accepted
a = int(input()) print(a+a**2+a**3)
p02556
s189922963
Accepted
n = int(input()) a = [] b = [] for i in range(n): x,y = map(int, input().split()) a.append(x+y) b.append(x-y) a.sort() b.sort() ans = a[-1]-a[0] c = b[-1]-b[0] print (max(ans,c))
p02843
s444713356
Accepted
x = int(input()) dp = [0]*10**6 dp[0] = 1 for i in range(10**5+1000): if dp[i] == 1: for j in range(100, 106): dp[i+j] = 1 print(dp[x])
p02642
s629067288
Accepted
from collections import Counter def main(): N = int(input()) A = list(map(int, input().split(' '))) counter = Counter(A) searched = [0 for _ in range(10 ** 6 + 1)] ans = 0 for i in range(1, 10 ** 6 + 1): if counter[i] == 0: continue if searched[i] == 0 and counter[i] == 1: ans += 1 for j in range(1, ((10 ** 6) // i) + 1): searched[i * j] = 1 print(ans) if __name__ == '__main__': main()
p04020
s697129613
Wrong Answer
def solve(n, a): res = 0 for i in range(n-1): if (a[i] == a[i+1]) and (a[i] % 2 == 1): res += a[i] a[i+1] = 0 else: res += a[i] // 2 a[i] = 0 if a[-1] > 0: res += a[-1] // 2 return res n = int(input()) a = [int(input()) for i in range(n)] print(solve(n, a))
p03705
s206159295
Wrong Answer
n, a, b = map(int,input().split()) print(b*(n-1)+a - b+(n-1)*a+1)
p03380
s049894341
Wrong Answer
import bisect n = int(input()) a = list(map(int,input().split())) a.sort() amax = a[-1] if amax//2 in set(a): print(amax,amax//2) else: ind = bisect.bisect_left(a,amax//2) MIN = min(abs(a[ind]-(amax//2)),abs(a[ind-1]-(amax//2))) if MIN == abs(a[ind]-(amax//2)): print(amax,a[ind]) exit() else: print(amax,a[ind-1]) exit()
p03627
s449640604
Wrong Answer
import collections n = int(input()) a = list(map(int,input().split())) c = collections.Counter(a) count_4 = [i[0] for i in c.items() if i[1] >= 4] if len(count_4) >= 1: max_4 = count_4[-1] else: max_4 = 0 count_2 = [i[0] for i in c.items() if i[1] >= 2] if len(count_2) >= 2: max_2_0 = count_2[-1] max_2_1 = count_2[-2] else: max_2_0 = 0 max_2_1 = 0 print(max(max_4**2, max_2_0*max_2_1))
p03639
s242014662
Accepted
n = int(input()) a = list(map(int,input().split())) b = 0 c = 0 for i in a: if i % 4 == 0: b += 1 elif i % 2 == 0: c += 1 if b >= n // 2: print("Yes") elif c >= (n-2*b): print("Yes") else: print("No")
p02624
s746763158
Accepted
n=int(input()) from itertools import * s=[*accumulate(range(n+1))] a=0 for i in range(1,n+1): a+=i*s[n//i] print(a)
p03627
s538944702
Accepted
from collections import Counter N=int(input()) A=Counter(list(map(int,input().split()))) x=[0,0] for a in A: if A[a]>1:x.append(a) if A[a]>3:x.append(a) x.sort() print(x[-1]*x[-2])
p03319
s413390331
Accepted
from math import ceil n, k = map(int, input().split()) _ = list(map(int, input().split())) print(ceil((n-1)/(k-1)) if k<n else 1)
p02577
s047357131
Accepted
n=int(input()) a=int(n%9) if a==0: print("Yes") else: print("No")
p02645
s538349402
Accepted
S = list(input()) for i in S[:3]: print(i,end="") print() # print(str())
p03836
s799745183
Wrong Answer
sx, sy, tx, ty = map(int, input().split()) res = "" res += "U" * (ty - sy) + "R" * (tx - sx) res += "D" * (ty - sy) + "L" * (tx - sx) print(res)
p02818
s195203607
Wrong Answer
a, b, k = map(int, input().split()) if k - a > 0: k -= a if b - k >= 0: print(0, b - k) else: print("0 0") else: print(k - a, b)
p03387
s951848713
Accepted
A, B, C = map(int, input().split()) M = max(A, B, C) s = 3 * M - A - B - C if s % 2 == 0: ans = s // 2 else: ans = (s + 3) // 2 print(ans)
p03087
s853717667
Accepted
n, q = [int(i) for i in input().split()] s = input() l = [] r = [] for _ in range(q): i, k = [int(i) for i in input().split()] l.append(i) r.append(k) cum_sum = [0] for i in range(n-1): if s[i:i+2] == 'AC': cum_sum.append(cum_sum[-1]+1) else: cum_sum.append(cum_sum[-1]) else: cum_sum.append(cum_sum[-1]) for i, k in zip(l, r): print(cum_sum[k-1] - cum_sum[i-1])
p02576
s837008421
Wrong Answer
import math N,X,T=map(int,input().split(' ')) ans=math.ceil(X/N)*T print(ans)
p02994
s189727663
Accepted
N,L=map(int,input().split()) if L>0: print(sum(L+i for i in range(1,N))) elif L+N-1<0: print(sum(L+i for i in range(N-1))) else: print(sum(L+i for i in range(N)))
p03774
s560275123
Accepted
n, m=map(int, input().split()) ab=[list(map(int, input().split())) for _ in range(n)] cd=[list(map(int, input().split())) for _ in range(m)] for i in range(n): k=float('inf') for j in range(m): l=abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1]) if l<k: k=l out=j+1 print(out)
p02684
s732047073
Accepted
n, k = map(int, input().split()) a = [[int(x)-1 for x in input().split()]] for i in range(1, k.bit_length()): ith = [a[-1][a[-1][i]] for i in range(n)] a.append(ith) ans = 0 for i in range(k.bit_length()): if (k >> i) & 1: ans = a[i][ans] print(ans+1)
p03017
s218743403
Accepted
n,a,b,c,d=map(int,input().split()) s=list(str(input())) for i in range(a+1,max(c,d)-1): if s[i]==s[i+1]=='#': print('No') break else: if c<d: print('Yes') else: for i in range(b-2,d-1): if s[i]==s[i+1]==s[i+2]=='.': print('Yes') break else: print('No')
p03672
s779518764
Wrong Answer
s=input() while True: s=s.replace(s[-1],'') if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]: print(len(s)) break
p02910
s315763210
Accepted
import sys input = lambda: sys.stdin.readline().rstrip() input_nums = lambda: list(map(int, input().split())) def main(): S = list(input()) even = set(S[1::2]) odd = set(S[0::2]) o = {'R', 'U', 'D'} e = {'L', 'U', 'D'} res = 'Yes' if not(even <= e) or not(odd <= o): res = 'No' print(res) if __name__ == '__main__': main()
p03799
s347634990
Accepted
n,m=map(int,input().split()) ans=0 if(2*n<=m): ans+=n m-=2*n ans+=m//4 else: ans+=m//2 print(ans)
p02747
s724652840
Accepted
S = str(input()) hitati = ["hi","hihi","hihihi","hihihihi","hihihihihi"] if S in hitati: print("Yes") else: print("No")
p02725
s383033227
Wrong Answer
import sys sys.setrecursionlimit(10**7) input = lambda: sys.stdin.readline().strip() def main(): K,N = map(int,input().split()) A_list = list(map(int,input().split())) dist_list = [] A_list.append(K) for i in range(1,len(A_list)): dist_list.append(A_list[i]-A_list[i-1]) d_sorted = sorted(dist_list) print(int(sum(d_sorted[0:N-1]))) main()
p03548
s581642908
Accepted
a,b,c = map(int,input().split()) print((a-c)//(b+c))
p02818
s882729020
Accepted
a,b,k=map(int,input().split()) if a>=k: a=a-k elif a+b>=k: b=b-(k-a) a=0 else: a=0 b=0 print(a,b)
p03719
s255458891
Wrong Answer
a,b,c=map(int,input().split()) if b<=a and a<=c: print("Yes") else: print("No")
p03284
s726857583
Accepted
p,q= input().split() a,b =(int(p), int(q)) if a % b == 0: print(0) else: print(1)
p03035
s809439890
Accepted
a, b = map(int, input().split()) if 13 <= a: print(b) elif 6 <= a and a <= 12: print(int(b/2)) else: print(0)
p03324
s884684698
Wrong Answer
d,n=map(int,input().split()) if d == 0: print(n if n!=100 else "101") elif d == 1: print(n*100 if n!=100 else 10100) else: print(n*10000 if n!=100 else 1000100)
p02838
s354574879
Wrong Answer
N = int(input()) A = list(map(int, input().split())) bitlist = [0] * 60 for i in A: for index, num in enumerate(reversed(bin(i)[2:])): if num == "1": bitlist[index] += 1 ans = 0 for bit, num in enumerate(bitlist): ans += num * (N-num) * (2 ** bit) print(ans)
p02748
s773429582
Accepted
A, B, M = input().split() A=int(A) B=int(B) M=int(M) a = list(map(int, input().split())) b = list(map(int, input().split())) x = [list(map(int, input().split())) for i in range(M)] dis = [] for i in range(M): m = x[i][0]-1 n = x[i][1]-1 dis.append(a[m] + b[n] - x[i][2]) a.sort() b.sort() dis.append(a[0]+b[0]) print(min(dis))
p02659
s762425132
Accepted
import decimal a, b = input().split() a = decimal.Decimal(a) b = decimal.Decimal(b) print(int(a*b))
p03971
s284855586
Accepted
n,a,b = map(int, input().split()) s = list(input()) sa = 0 sb = 0 for i in range(n): if s[i]=="a": if sa+sb<a+b: print("Yes") sa += 1 else: print("No") elif s[i]=="b": if sa+sb<a+b and sb<b: print("Yes") sb += 1 else: print("No") else: print("No")
p03038
s987775665
Accepted
from heapq import * n, m = map(int, input().split()) A = list(map(int, input().split())) h = [] for a in A: heappush(h, ((-1) * a, 1)) for _ in range(m): b, c = map(int, input().split()) heappush(h, ((-1) * c, b)) ans = 0 for _ in range(len(A)): c, b = heappop(h) ans += (-1) * c if b > 1: heappush(h, (c, b - 1)) print(ans)
p03360
s051942333
Accepted
l = list(map(int, input().split())) k = int(input()) l.sort() print(l[2]*(2**k)+l[0]+l[1])
p03252
s979482405
Wrong Answer
s=input() t=input() ds={} dt={} l=[] for i in range(len(s)): if s[i]!=t[i]: if t[i] not in dt: dt[t[i]]=0 if s[i] not in ds: ds[s[i]]=0 else: if s[i] in ds or s[i] in dt: print('No') exit() print('Yes')
p03693
s209202233
Accepted
r,g,b=map(int,input().split()) ans=r*100+g*10+b if ans%4==0: print('YES') else: print('NO')
p02756
s302873264
Accepted
# coding: utf-8 from collections import deque S = deque(input()) Q = int(input()) cnt = 0 for i in range(Q): q = input().split() if q[0] == "1": cnt += 1 else: if (int(q[1]) + cnt) % 2 == 1: S.appendleft(q[2]) else: S.append(q[2]) ans = "".join(S) print(ans if cnt % 2 == 0 else ans[::-1])
p03001
s552177924
Accepted
w, h, x, y = map(int, input().split()) square = (w * h) / 2 flg = 0 if x == w / 2 and y == h / 2: flg = 1 print(square, flg)
p03680
s602392974
Accepted
N = int(input()) a = [int(input()) for _ in range(N)] ans, nex = 1, a[0] while ans < N and nex != 2: nex = a[nex - 1] ans += 1 print(ans if ans != N else -1)
p02958
s088575755
Accepted
n=int(input()) a=list(map(int,input().split())) l=sorted(a) cnt=0 for i in range(n): if int(a[i])!=int(l[i]): cnt+=1 if cnt>2: print('NO') else: print('YES')
p03077
s076619013
Wrong Answer
N=int(input()) A = [int(input()) for _ in range(5)] print(N//min(A)+5)
p02613
s514010407
Wrong Answer
N = int(input()) Si = [input for i in range(N)] C0 = 0 C1 = 0 C2 = 0 C3 = 0 for in1 in Si: if in1 == "AC": C0 +=1 elif in1 == "WA": C1 += 1 elif in1 == "TLE": C2 += 1 elif in1 == "RE": C3 += 1 print("AC x {}".format(C0)) print("WA x {}".format(C1)) print("TLE x {}".format(C2)) print("RE x {}".format(C3))