problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03131
s715763772
Wrong Answer
K, A, B = map(int, input().split()) if A >= B or K <= A: print(K + 1) else: print(A + ((K - A + 1) // 2) * (B - A) + ((K - A + 1) // 2))
p03161
s211653697
Accepted
MAX_N = 10**5+100 INF = float('inf') N, K = map(int, input().split()) h = list(map(int, input().split())) # dp table # dp[i] := 足場iに行くのにかかる最小のコスト dp = [INF]*MAX_N dp[0] = 0 for i in range(1,N): for j in range(1,K+1): if i-j>=0: dp[i] = min(dp[i],dp[i-j]+abs(h[i]-h[i-j])) print(dp[N-1])
p02912
s688018164
Accepted
import heapq n, m = map(int, input().split()) a = list(map(lambda x: -int(x), input().split())) heapq.heapify(a) for _ in range(m): heapq.heappush(a, -(-heapq.heappop(a) // 2)) print(-sum(a))
p03592
s327612501
Accepted
N, M, K = map(int, input().split()) def check(): for i in range(M): P = M-2*i K1 = K - i*N if P==0: if K1 == 0: return True return False if K1%P==0 and K1//P<=N and K1//P>=0: return True return False if check(): print('Yes') else: print('No')
p03997
s864920570
Accepted
a=int(input()) b=int(input()) h=int(input()) print(int((a+b)*h/2))
p02615
s786187150
Wrong Answer
n = int(input()) a = list(map(int, input().split())) a=sorted(a,reverse=True) ans=0 for i in range(n-1): if i<n//2+1: ans+=a[i] else: ans+=a[i-n//2] print(ans)
p02660
s197970950
Accepted
import math def solve(): N = int(input()) ans = 0 for i in range(2, int(math.sqrt(N)) + 2): n = 1 cnt = 0 while N % i == 0: N //= i cnt += 1 if cnt == n: cnt = 0 n += 1 ans += 1 if N != 1: ans += 1 return ans print(solve())
p02982
s345178896
Accepted
import math N, D = map(int, input().split()) X = [list(map(int, input().split())) for _ in range(N)] ans = 0 for i in range(N-1): for j in range(i+1, N): tmp = 0 for k in range(D): tmp +=(X[i][k]-X[j][k])**2 tmp = math.sqrt(tmp) if (tmp.is_integer()): ans += 1 print(ans)
p03659
s268995533
Accepted
def resolve(): n = int(input()) a = list(map(int, input().split())) s = [0]*(n+1) for i in range(n): s[i+1] = s[i] + a[i] ans = float('inf') for i in range(1, n): ans = min(ans, abs(s[-1] - s[i]*2)) print(ans) resolve()
p03986
s452063567
Wrong Answer
x = input() ans = len(x) cnt = {"S":0,"T":0} tar = "S" for c in x: if c == "S" and tar == "T": ans -= min(cnt.values())*2 cnt = {"S":0,"T":0} cnt[c] += 1 tar = c else: if tar == "T": ans -= min(cnt.values())*2 print(ans)
p03835
s336606588
Wrong Answer
K,S=map(int,input().split()) ANS=0 for i in range(K+1): if i > S: break for j in range(K+1-i): zz = i + j if zz > S: break for k in range(K+1-zz): z = i + j + k if z == S: #print(i,j,k) ANS+=1 elif z >= S: break print(ANS)
p03221
s302651911
Accepted
N, M = map(int, input().split()) Pref = [[]for _ in range(N)] City = [] for _ in range(M): prefecture, year = map(int, input().split()) prefecture -= 1 Pref[prefecture].append([_, year]) for i in range(N): Pref[i].sort(key=lambda x: x[1]) for j in range(len(Pref[i])): s1 = str(i+1).zfill(6) s2 = str(j+1).zfill(6) Pref[i][j].append(s1+s2) City.append(Pref[i][j]) City.sort() for a, b, c in City: print(c)
p03705
s888475783
Accepted
N, A, B = map(int, input().split()) if A > B : print(0) elif N == 1 : print(0 if A != B else 1) else : print((B - A) * (N - 2) + 1)
p03644
s757337810
Wrong Answer
def gusuuhantei(i): count = 0 num = i while True: if num % 2 ==0 and not num == 0: num = num / 2 count += 1 else: break return count N = int(input()) li = [0]*(N+1) for i in range(N+1): li[i] = gusuuhantei(i) Maxcount = max(li) index = li.index(Maxcount) print(index)
p03038
s623170425
Wrong Answer
import heapq N, M = list(map(int,input().split())) A = list(map(int,input().split())) B = [list(map(int,input().split())) for i in range(M)] B = sorted(B, key = lambda x: x[1])[::-1] heapq.heapify(A) cnt = 0 for i in range(M): for _ in range(B[i][0]): heapq.heappush(A, -max(-heapq.heappop(A), B[i][1])) cnt += B[i][0] if cnt >= N: break print(-sum(A))
p02862
s705797426
Accepted
import sys sys.setrecursionlimit(10**7) input = sys.stdin.readline mod = 10**9+7 def comb(n, k): c = 1 for i in range(k): c *= n - i c %= mod d = 1 for i in range(1, k + 1): d *= i d %= mod return (c * pow(d, mod - 2, mod)) % mod x,y = map(int, input().split()) if (x + y) % 3 != 0: print(0) exit() n = (x + y) // 3 x -= n y -= n if x < 0 or y < 0: print(0) exit() print(comb(x + y, x))
p02629
s762046374
Wrong Answer
alp = [chr(i) for i in range(97, 97+26)] N = int(input()) q = N s = "" while True: q,m = divmod(q,26) if m == 0: m = 26 if q == 1: q = 0 s = alp[m - 1] + s if q == 0: break print(s)
p03838
s146591605
Wrong Answer
import sys read = sys.stdin.read readlines = sys.stdin.readlines def main(): x, y = map(int, input().split()) if x < y: r = y - x print(r) else: if 0 <= y and 0 <= x: print(x * 2 - (x - y) + 1) elif y < 0 and 0 <= x: print(x - abs(y) + 1) else: print((x - y) + 2) if __name__ == '__main__': main()
p03417
s252422209
Accepted
n,m = map(int,input().split()) if n == m == 1: print(1) elif n == 1 or m == 1: print((n*m)-2) else: print((n*m)+4-(n+m)*2)
p02862
s068106700
Accepted
X, Y = map(int, input().split()) x, y = (X*2-Y)//3, (Y*2-X)//3 mod = 10**9+7 n = min(x, y) factorial = [1] for i in range(1, n+1): factorial.append((factorial[i-1]*i)%mod) p_list = [(x+y)%mod] for i in range(1, n+1): p_list.append((p_list[i-1]*(x+y-i))%mod) if (X+Y)%3 != 0: print (0) elif x < 0 or y < 0: print (0) elif n == 0: print (1) else: print (p_list[n-1]*pow(factorial[n], 10**9+5, mod)%mod)
p02972
s593745104
Wrong Answer
N=int(input()) a=list(map(int,input().split())) box=[0]*N for i in range(N, 0,-1): sm = 0 for j in range(i, N+1, i): sm += box[j-1] print(i, sm) box[i-1] = (sm % 2) ^ a[i-1] print(sum(box)) print(*[i+1 for i in range(N) if box[i]])
p02602
s346659755
Wrong Answer
n,*a=map(int,open(0).read().split()) ans=1000 num= 0 for i in range(n): if i == n-1: if a[i-1]<a[i]: ans += a[i]*num elif a[i]<a[i+1] and a[i+1]<ans: num = ans//a[i] ans = ans%a[i] elif a[i]<a[i+1] and a[i+1]>ans: continue elif a[i] == a[i+1]: continue else: ans += num*a[i] print(ans)
p03695
s844815082
Accepted
n = int(input()) a = [int(_) for _ in input().split()] col = [0] * n cnt = 0 for i in range(n): if a[i] >= 3200: col[i] = 8 cnt += 1 else: col[i] = a[i] // 400 ans_min = len(set(col)) ans_max = ans_min if cnt == n: ans_min = 1 ans_max = cnt elif cnt > 0: ans_min -= 1 ans_max = ans_min + cnt print(ans_min, ans_max)
p02725
s000551076
Wrong Answer
K,N=map(int,input().split()) A=list(map(int,input().split())) l=0 for i in range(N-2): if (A[i+2]-A[i+1])>=(A[i+1]-A[i]): l=A[i+2]-A[i+1] if (20-A[N-1]+A[0])>=l: l=20-A[N-1]+A[0] print(K-l)
p03814
s899270431
Accepted
s = input() print(len(s)-''.join(reversed(s)).find('Z')-s.find('A'))
p03221
s360541734
Wrong Answer
n, m = map(int, input().split()) py = sorted([[i] + list(input().split()) for i in range(m)], key=lambda x: (x[1], x[2])) x = sorted(py)[0][1] a = 1 ans = [] for i, p, y in py: if x != int(p): x = int(p) a = 1 ans.append([i, p.zfill(6)+str(a).zfill(6)]) a += 1 for i, v in sorted(ans): print(v)
p02623
s603500001
Wrong Answer
n, m, k = [int(i) for i in input().split()] book_list = [int(i) for i in input().split()] book_list.extend([int(i) for i in input().split()]) book_list.sort() times = 0 book_num = 0 for i in book_list: if times + i > k: break times += i book_num += 1 print(book_num)
p02911
s424369728
Accepted
n,k,q=map(int,input().split()) correct=[0]*n for i in range(q): a=int(input()) correct[a-1]+=1 for i in range(n): if k<=q-correct[i]: print("No") else: print("Yes")
p02694
s647521459
Wrong Answer
import math X = int(input()) original = 100 n = 0 while True: n+=1 original = math.ceil(original * 1.01) if original >= X: break print(n)
p02823
s311864352
Accepted
N, A, B = map(int, input().split()) distance = abs(A - B) if distance % 2 == 1: print(min(A - 1, N - B) + 1 + (distance - 1) // 2) else: print(distance // 2)
p03693
s237667337
Wrong Answer
r,g,b=input().split() x=r+g+b y=int(x) if y%4==0: print('Yes') else: print('No')
p03309
s283479134
Wrong Answer
# input N = int(input()) A = list(map(int, input().split())) # check B = sorted( [ abs(a - (i + 1)) for i, a in enumerate(A) ] ) median = B[N // 2] res = 0 for i in range(N): res += max(median - B[i], -median + B[i]) print(res)
p03494
s807612395
Wrong Answer
input() A = list(map(int, input().split())) A.sort() minval = A[0] count = 0 while minval % 2 == 0: minval /= 2 count += 1 print(count)
p03419
s639074668
Wrong Answer
n, m = map(int, input().split()) if n == 1: print(m-2) elif m == 1: print(n-2) elif n == 2 or m == 2: print(0) else: print((n-2) * (m-2))
p02647
s905813462
Accepted
n,k = map(int, input().split()) a = list(map(int, input().split())) for i in range(k): nxt = [0]*n for j in range(n): l = j-a[j] r = j+a[j]+1 if l < 0: l = 0 nxt[l] += 1 if r < n: nxt[r] -= 1 for j in range(n-1): nxt[j+1] += nxt[j] if a == nxt: break a = nxt print(*a)
p02606
s286921039
Accepted
L, R, d = map(int,input().split()) num = d ans = 0 while num <= R: if num >= L: ans+=1 num +=d print(ans)
p02888
s332971145
Wrong Answer
N = int(input()) L = list(map(int,input().split())) L.sort() count = 0 for i in range(N-2): if L[i+2] < L[i+1] + L[i]: count += 1 print(count)
p02658
s694000011
Wrong Answer
N=int(input()) A=list(map(int, input().split())) ans=1 flg=0 for i in range(N): if ans>10**18: flg=1 break else: ans*=A[i] if flg==0: print(ans) else: print(-1)
p02743
s760696949
Wrong Answer
from decimal import * getcontext().prec = 5000 #import numpy as np a, b, c = map(float, input().split()) ##print(a**0.5, b**0.5, c**0.5) if Decimal(a).sqrt()+ Decimal(b).sqrt() < Decimal(c).sqrt(): print('Yes') else: print('No')
p02546
s802907701
Accepted
s = list(input().strip()) len_s = len(s) if s[len_s-1] == "s": s += "es" else: s += "s" s= "".join(s) print(s)
p03779
s160120251
Accepted
x = int(input()) cnt = 0 i = 0 while i < x: i += cnt cnt += 1 print(cnt - 1)
p03639
s053236044
Wrong Answer
N = int(input()) a = list(map(int,input().split())) count = 0 count2 = 0 count0 = 0 for i in range(N): if a[i]%4 == 0: count += 1 elif a[i]%2 == 0: count2 += 1 else: count0 += 1 if count2 == 0: if count0 <= count + 1: print("Yes") else: print("NO") else: if count0 <= count: print("Yes") else: print("NO")
p02691
s018794533
Accepted
N = int(input()) A = [int(i) for i in input().split()] i_Ai = {} cnt = 0 for i, h in enumerate(A): imh = i - h if imh in i_Ai: cnt += i_Ai[imh] iph = i + h if iph in i_Ai: i_Ai[iph] += 1 else: i_Ai[iph] = 1 print(cnt)
p02661
s527809592
Accepted
n = int(input()) A = [] B = [] for i in range(n): a, b = map(int, input().split()) A.append(a) B.append(b) A.sort() B.sort() if n%2 == 1: ans = B[n//2]-A[n//2]+1 else: x = A[n//2-1]+A[n//2] y = B[n//2-1]+B[n//2] ans = y-x+1 print(ans)
p02838
s589088507
Accepted
import numpy as np n = int(input()) a = np.array(list(map(int, input().split()))) max_digits = 60 MOD = 10**9 + 7 ans = 0 for i in range(max_digits): one_num = np.count_nonzero((a >> i) & 1) radix_mod = 2**i % MOD ans += (radix_mod * one_num * (n - one_num)) % MOD print(ans%MOD)
p02711
s370971809
Wrong Answer
n=int(input()) res="No" for i in range(3): if n%7==0: res="Yes" n//=10 print (res)
p03210
s039554690
Wrong Answer
X = int(input()) if X in [3, 5, 7]: print('YES') else: print('No')
p03160
s037997322
Accepted
n = int(input()) h = list(map(int,input().split())) dp = [10**4] * (n+1) dp[0] = 0 dp[1] = abs(h[1]-h[0]) for i in range(2,n): dp[i] = min(dp[i-2] + abs(h[i-2] - h[i]), dp[i-1] + abs(h[i-1] - h[i])) # print(dp) print(dp[n-1])
p02951
s084346418
Accepted
a, b, c = map(int, input().split()) print(max(0, c - (a - b)))
p02689
s401548227
Accepted
#!/usr/bin/env python3 N, M = list(map(int, input().split())) h_list = list(map(int, input().split())) h_dict = {i + 1: h for i, h in enumerate(h_list)} h_set = set(h_dict.keys()) no_list = [] for _ in range(M): a, b = list(map(int, input().split())) if h_dict[a] == h_dict[b]: no_list.append(a) no_list.append(b) elif h_dict[a] > h_dict[b]: no_list.append(b) else: no_list.append(a) no_set = set(no_list) ans = len(h_set - no_set) print(ans)
p02838
s845350115
Wrong Answer
N = int(input()) MOD = 1e+9 + 7 a = [int(i) for i in input().split()] ans = 0 for i in range(N): for j in range(i+1, N): ans += a[i] ^ a[j] ans %= MOD print(ans)
p02727
s911404154
Accepted
x, y, a, b, c = map(int, input().split()) p = list(map(int, input().split())) q = list(map(int, input().split())) r = list(map(int, input().split())) p.sort(reverse=True) q.sort(reverse=True) r.sort(reverse=True) ans = p[:x] + q[:y] + r[:x+y] ans.sort(reverse=True) print(sum(ans[:x+y]))
p03011
s324593850
Accepted
p, q, r = map(int, input().split()) print(min(p + q, q + r, r + p))
p02719
s728059446
Wrong Answer
n, k = map(int, input().split()) if n == 0: print(k) elif n % k == 0: print(0) elif n < k: print(n) else: rem = n % k if abs(rem-k) < rem: print(abs(rem-k)) else: print(rem)
p02873
s973476816
Accepted
# Problem A - >< S = input() N = len(S) + 1 num_list = [0]*N ans_sum = 0 # < process for i in range(len(S)): s = S[i] if s=="<": num_list[i+1] = num_list[i] + 1 # > process for i in range(len(S)-1, -1, -1): s = S[i] if s==">": num_list[i] = max(num_list[i], num_list[i+1]+1) # sum process for i in range(N): ans_sum = ans_sum + num_list[i] print(ans_sum)
p03380
s127393245
Accepted
#!/usr/bin/env python # coding: utf-8 # In[15]: n = int(input()) a = list(map(int, input().split())) # In[18]: a.sort() ai = max(a) diff = ai old = diff for x in a[:-1]: tmp = abs(x-ai/2) if tmp <= diff: aj = x diff = tmp if diff == old: break else: old = diff print(ai,aj) # In[ ]:
p03030
s830430901
Accepted
N = int(input()) sp = [] for i in range(N): s, p = input().split() sp.append([s, int(p), i+1]) sp1 = sorted(sp, key = lambda x: (x[0], -1*x[1])) for i in range(N): print(sp1[i][2])
p03814
s380841509
Accepted
s = input() first_A = None last_Z = None for i, c in enumerate(s): if c == 'A' and first_A is None: first_A = i if c == 'Z': last_Z = i print(last_Z-first_A+1)
p03665
s920581624
Accepted
N,P = map(int,input().split()) A = list(map(int,input().split())) C = {0:0,1:0} for i in range(N): if A[i]%2==0: C[0] += 1 else: C[1] += 1 if P==0: if C[1]==0: n = 2**C[0] else: n = 2**C[0]*2**(C[1]-1) else: if C[1]==0: n = 0 else: n = 2**C[0]*2**(C[1]-1) print(n)
p02554
s727576518
Accepted
import math import collections import fractions import itertools import functools import operator import bisect N = int(input()) def solve(): mod = 10**9+7 ans = 10**N - (9**N)*2 + 8**N ans %= mod print(ans) return 0 if __name__ == "__main__": solve()
p03011
s858560987
Accepted
a,b,c = [int(a) for a in input().split()] d = min(a+b,b+c,c+a) print (d)
p02693
s660374893
Accepted
K = int(input()) A,B = map(int,input().split()) count = 0 for i in range(A,B+1): if(i % K == 0): count += 1 else: pass if(count != 0): print("OK") else: print("NG")
p02983
s391893542
Accepted
l,r=map(int,input().split()) sho_l = l // 2019 sho_r = r // 2019 if sho_r-sho_l >= 1: print(0) else: ans = 2018 for i in range(l,r): for j in range(i+1,r+1): ans = min((i*j)%2019,ans) print(ans)
p03524
s313218096
Wrong Answer
s = input() a = [0]*3 for i in s: a[ord(i)-97] += 1 a = sorted(a) if a[2] != a[1] and (a[2]-a[0])%3 == 2 and (a[1]-a[0])%3==1: print("NO") else: print("YES")
p02732
s038728579
Wrong Answer
import collections N=int(input()) a=0 list1 = list(map(int, input().split())) c = collections.Counter(list1) for i in range(N): a+=int(c[i+1]*(c[i+1]-1)/2) for i in range(N): print(a-c[list1[i]]*2+3)
p02727
s385336140
Accepted
x, y, a,b, c = map(int, input().split()) P = list(map(int, input().split())); P.sort(); P.reverse() Q = list(map(int, input().split())); Q.sort(); Q.reverse() R = list(map(int, input().split())); R.sort(); R.reverse() ans = P[:x] + Q[:y] + R ans.sort(); ans.reverse() ans = ans[:(x + y)] print (sum(ans))
p02631
s482531284
Accepted
def sep(): return map(int,input().strip().split(" ")) def lis(): return list(sep()) n=int(input()) ar=lis() k=0 for i in ar: k=(k^i) for i in ar: print(k^i,end=" ")
p02693
s500251877
Accepted
k = int(input()) a, b = map(int, input().split()) cnt = 0 for i in range(a, b+1): if i % k == 0: print('OK') cnt += 1 break if cnt == 0: print('NG')
p02603
s404324514
Accepted
N = int(input()) A = list(map(int,input().split())) M = 1000 X = 0 i = 0 while i<N-1: if A[i]<A[i+1]: M = M + X * A[i] X = M // A[i] M = M - X * A[i] i += 1 elif A[i]>A[i+1]: M = M + X * A[i] X = 0 i += 1 else: i += 1 print(A[N-1] * X + M)
p03250
s781519081
Accepted
a,b,c=map(int,input().split()) print(max(a,b,c)*9+a+b+c)
p03796
s498037893
Accepted
n=int(input()) mod=10**9+7 ans=1 for i in range(1,n+1): ans=(ans*i)%mod print(ans)
p02833
s742541317
Accepted
N = int(input()) if N % 2 == 1: print(0) exit() tmp = 2 ans = 0 while tmp < N: tmp *= 5 ans += N // tmp print(ans)
p03910
s365651060
Wrong Answer
n = int(input()) i = 0 while True: if i*(i+1)//2 >= n: break i += 1 while True: print(i) n -= i i -= 1 if n - i <= 0: print(n) break
p03328
s847862851
Wrong Answer
a,b = map(int,input().split()) print(((1+(b-a))*(b-a))//2)
p02699
s885722896
Accepted
s,w = list(map(int,input().split())) if s <= w: print("unsafe") else: print("safe")
p02695
s116016315
Accepted
import numpy as np import itertools N ,M ,Q = map(int,input().split(' ')) ABCD = [] for _ in range(Q): ABCD.append(list(map(int,input().split()))) ALL = list(itertools.combinations_with_replacement(range(1,M+1), N)) MAX = 0 for row in ALL: SUM = 0 for a,b,c,d in ABCD: if (row[b-1] - row[a-1]) == c: SUM += d MAX = max(MAX,SUM) print(MAX)
p02785
s963023072
Accepted
n, k = map(int, input().split()) h = list(map(int, input().split())) h.sort() ans = 0 if len(h) == n: for i in range(k): try: h.pop() except: pass for x in h: ans += x print(ans)
p02663
s413828335
Accepted
H1, M1, H2, M2, K = map(int, input().split()) print((H2 * 60 + M2) - (H1 * 60 + M1) - K)
p02547
s393020889
Wrong Answer
n = int(input().strip()) count = 0 for i in range(n): a,b = map(int,input().strip().split()) if a == b and count == 3: print('YES') elif a == b: count += 1 else: count = 0 print('NO')
p02647
s518421443
Accepted
import numpy as np from numba import jit N,K=map(int,input().split()) A=np.array(list(map(int,input().split())),dtype=np.int64) @jit def loop(a,k): if k>41: ans=np.ones(N,dtype=np.int64)*N else: ans=a for j in range(k): B=np.zeros(N+1,dtype=np.int64) for i in range(N): B[max(0,i-int(ans[i]))] +=1 B[min(N,i+int(ans[i])+1)] -=1 ans=np.cumsum(B)[:N] return ans for i in loop(A,K): print(i)
p03377
s432291327
Wrong Answer
a,b,x = map(int,input().split()) if a >= x: print("NO") elif a + b >= x: print("YES") else: print("NO")
p04044
s838811411
Wrong Answer
n, l = map(int, input().split()) d = {} for i in range(n): d[input()] = 0 s = sorted(d.keys(), key=lambda x: x[0]) ans = [] for i in s: ans.append(i) print("".join(ans))
p03773
s764492495
Wrong Answer
a,b=map(int,input().split()) print(a+b if a+b <= 24 else a + b -24)
p03160
s584630541
Accepted
import sys INF = sys.maxsize N = int(input().strip()) h = [int(x) for x in input().split()] memo = [INF] * N for i in range(N - 1, -1, -1): if i == N -1: memo[i] = 0 else: memo[i] = min( memo[i + 1] + abs(h[i] - h[i + 1]) if i + 1 < N else INF, memo[i + 2] + abs(h[i] - h[i + 2]) if i + 2 < N else INF ) print(memo[0])
p02600
s033037740
Accepted
rate = int(input()) if rate < 600: print(8) elif rate < 800: print(7) elif rate < 1000: print(6) elif rate < 1200: print(5) elif rate < 1400: print(4) elif rate < 1600: print(3) elif rate < 1800: print(2) else: print(1)
p03073
s726814070
Wrong Answer
s=input() tmp1 = '' tmp2 = '' for i in range(len(s)): if i // 2 == 0: tmp1 += '0' tmp2 += '1' else: tmp1 += '1' tmp2 += '0' diff_tmp1 = 0 diff_tmp2 = 0 for i in range(len(s)): if tmp1[i] != s[i]: diff_tmp1 += 1 elif tmp2[i] != s[i]: diff_tmp2 += 1 print(min(diff_tmp1,diff_tmp2))
p02705
s842822027
Wrong Answer
a=int(input()) print(a * 3.1415)
p03059
s745878092
Accepted
a,b,t=map(int,input().split()) print(t//a*b)
p03387
s312933862
Accepted
a, b, c = map(int, input().split()) h = max(a, b, c) s = a + b + c ans = 0 if h % 2 == s % 2: ans = (h * 3 - s) // 2 else: ans = ((h + 1) * 3 - s) // 2 print(ans)
p03557
s464755407
Wrong Answer
import bisect n = (int)(input()) a = sorted(list(map(int, input().split(" ")))) b = sorted(list(map(int, input().split(" ")))) c = sorted(list(map(int, input().split(" "))))
p02843
s025704234
Accepted
x = int(input()) a = x//100 b = x%100 if b <= a*5: print(1) else: print(0)
p03281
s012079875
Accepted
N = int(input()) ans = 0 for i in range(1, N + 1, 2): mod_count = 0 for j in range(1, i + 1): if i % j == 0: mod_count += 1 if mod_count == 8: ans += 1 print(ans)
p02583
s402490673
Accepted
n=int(input()) a=list(map(int,input().split())) ans=0 for x in range(n): for y in range(x+1,n): for z in range(y+1,n): if a[x]!=a[y] and a[y]!=a[z] and a[z]!=a[x] and a[x]+a[y]>a[z] and a[y]+a[z]>a[x] and a[z]+a[x]>a[y]: ans+=1 print(ans)
p02623
s700658290
Wrong Answer
import bisect n,m,k=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) A=[0] B=[0] for i in range(n): A.append(A[-1]+a[i]) for i in range(m): B.append(B[-1]+b[i]) ans=0 for i in range(n+1): index=bisect.bisect_right(B,k-A[i])-1 index=max(0,index) ans=max(ans,i+index) print(ans)
p02987
s634878740
Accepted
s=sorted(input()) if s[0]==s[1]!=s[2]==s[3]:print('Yes') else:print("No")
p03327
s470034849
Wrong Answer
N = int(input()) if N < 1000: print("ABC" + str(N)) else: print("ABD" + str(N)[1:3] + str((N + 1) % 10))
p02848
s101372370
Accepted
n = int(input()) s = input() for i in s: ord_s = ord(i) if ord_s + n <= 90: chr_s = chr(ord_s + n) else: chr_s = chr(ord_s + n - 26) print(chr_s, end = "")
p02552
s387921909
Accepted
ans = [1, 0] print(ans[int(input())])
p03338
s678886213
Accepted
N=int(input()) L=list(input()) maxa=-10 for i in range(N-1): a=set(L[:i+1]) b=set(L[i+1:]) maxa=max(maxa,len(a&b)) print(maxa)
p03126
s146923214
Accepted
n,m=map(int,input().split()) c,*a,=map(int,input().split()) for i in range(n-1): x,*y,=map(int,input().split()) a=list(set(a) & set(y)) print(len(a))