problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p04005
s932756536
Accepted
a = list(map(int,input().split())) a.sort(reverse = True) if a[0] % 2 == 0 or a[1] % 2 == 0 or a[2] % 2 == 0: print(0) exit(0) block = a[0] * a[1] * a[2] a[0] = a[0] // 2 x = a[0] * a[1] * a[2] y = block - x print(abs(x - y))
p02797
s550254859
Accepted
n,k,s=map(int,input().split()) ans=[] i=0 if(s!=10**9): for _ in range(n): if(i<k): ans.append(s) i+=1 else: ans.append(10**9) else: for _ in range(n): if(i<k): ans.append(s) i+=1 else: ans.append(1) print(*...
p03243
s545547239
Wrong Answer
n = int(input()) for i in range(111, 999, 111): if i >= n: print(i) break
p02623
s377996492
Wrong Answer
import itertools n, m, k = map(int, input().split()) a = [0] + list(map(int, input().split())) b = [0] + list(map(int, input().split())) sa = list(itertools.accumulate(a)) sb = list(itertools.accumulate(b)) max = 0 for i in range(1, n + 1): for j in range(1, m + 1): if (sa[i] + sb[j] <= k): i...
p02835
s866087381
Wrong Answer
*a,=map(int,input().split())
p02772
s746141641
Wrong Answer
list_ = [int(x) for x in input().split() if (int(x) % 2) == 0] for f in list_: if (f % 3 == 0) or (f % 5 == 0): continue else: print("DENIED") break else: print("APPROVED")
p02754
s736009697
Accepted
n,a,b = map(int,input().split()) cnt = int(n//(a+b)) res = int(n%(a+b)) if res <= a: print(cnt*a+res) else: print((cnt+1)*a)
p02748
s852113041
Wrong Answer
from collections import defaultdict import numpy as np A, B, M = map(int, input().split()) a = np.array(list(map(int, input().split()))) b = np.array(list(map(int, input().split()))) C = defaultdict(int) for i in range(M): x, y, c = map(int, input().split()) C[tuple([x-1, y-1])] = c ans = a.min() + b.min() ...
p03471
s545798065
Wrong Answer
n,y= map(int, input().split()) for i in range(0,n+1): for j in range(0,n+1-i): k=n-i-j if y==10000*i+5000*j+1000*k: print(i,j,k) break
p03720
s598930023
Accepted
n,m = map(int,input().split()) g = [[] for i in range(n)] for i in range(m): a,b = map(int,input().split()) g[a-1].append(b) g[b-1].append(a) for i in range(n): print(len((g[i])))
p04005
s798749534
Accepted
L = list(sorted(map(int, input().split()))) if L[0] % 2 == 0 or L[1] % 2 == 0 or L[2] % 2 == 0: print(0) else: print(L[0] * L[1])
p03208
s271392122
Accepted
n, k = [int(i) for i in input().split()] h = [int(input()) for _ in range(n)] h.sort() diff = [] for i in range(n-k+1): diff.append(h[i+k-1] - h[i]) print(min(diff))
p02689
s255262676
Wrong Answer
import numpy as np N, M = map(int,input().split()) C = np.zeros(N) d = 0 H = list(map(int,input().split())) for i in range(M): A, B = map(int,input().split()) if H[A - 1] < H[B -1]: C[A - 1] += 1 else: C[B - 1] += 1 for j in range(N): if C[j] == 0: d += 1 print(d)
p03407
s626421001
Accepted
a, b, c = map(int,input().split()) if a+b>=c: print("Yes") else: print("No")
p03557
s977706716
Accepted
import bisect N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() C.sort() ans = 0 for i in range(N): a_cnt = bisect.bisect_left(A, B[i]) c_cnt = N-bisect.bisect_right(C, B[i]) ans += a_cnt*c_cnt print(ans)
p03495
s295226383
Accepted
n,k = map(int,input().split()) nList = list(map(int,input().split())) nSet = list(set(nList)) nDic = {} for i in nList: if not(i in nDic.keys()): nDic[i] = 1 else: nDic[i] += 1 countList = sorted(nDic.values()) print(sum(countList[:(len(nSet)-k)]))
p02831
s803336013
Accepted
A, B = map(int,input().split()) import math print(int(A*B/math.gcd(A,B)))
p02873
s973090586
Accepted
s = input() n = len(s) + 1 a = [0 for i in range(n)] for i in range(n - 1): if s[i] == '<': a[i + 1] = max(a[i + 1], a[i] + 1) for i in reversed(range(n - 1)): if s[i] == '>': a[i] = max(a[i], a[i + 1] + 1) ans = sum(a) print(ans)
p03545
s100339896
Accepted
from itertools import permutations, combinations,combinations_with_replacement,product s = input() t = product(["+","-"],repeat=3) for i in t: calc = s[0]+i[0]+s[1]+i[1]+s[2]+i[2]+s[3] sum = eval(calc) if(sum==7): print(calc+"=7") break
p03627
s119901470
Accepted
N = int(input()) a = list(map(int, input().split())) val = set() ans = [] for i in a: if i in val: ans.append(i) else: val.add(i) ans.sort() if len(ans) == 0: print(0) else: if ans.count(ans[-1]) >= 4: print(ans[-1]**2) elif ans.count(ans[-1]) == 3: print(ans[-1]*ans...
p03274
s968679825
Wrong Answer
N,K=map(int,input().split()) x=list(map(int,input().split())) res=[] for i in range(N-K+1): tmp = abs(x[i])+x[i+K-1]-x[i] res.append(tmp) for i in range(N-K+1): tmp = x[-i-1]+x[-i-1]-x[-i-K] res.append(tmp) print(min(res))
p02793
s710502473
Accepted
N = int(input()) A = [int(x) for x in input().split()] from fractions import gcd mod = int(1e9 + 7) lcm = 1 for x in A: lcm = lcm * x // gcd(lcm, x) lcm %= mod ans = 0 for x in A: ans += lcm * pow(x, mod - 2, mod) ans %= mod print(ans)
p02823
s444298100
Accepted
import sys def input(): return sys.stdin.readline().rstrip() def main(): n,a,b=map(int,input().split()) if (b-a)%2==0:print((b-a)//2) else:print(min((b+a-1)//2,(2*n-b+1-a)//2)) if __name__=='__main__': main()
p03407
s141487405
Wrong Answer
a,b,c=map(int,input().split()) if (a+b)>c: print('Yes') else: print('No')
p02688
s095645315
Accepted
n, k = map(int, input().split()) d = [0]*k a = [0]*k for i in range(k): d[i] = int(input()) a[i] = list(map(int, input().split())) ans = [0]*100 for i in range(k): for j in range(d[i]): ans[a[i][j]-1] = 1 print(n-sum(ans))
p02909
s127493766
Accepted
S = input() if S == ('Sunny'): print('Cloudy') elif S == ('Cloudy'): print('Rainy') elif S == ('Rainy'): print('Sunny') else: print('入力に誤りがあります。Sunny,Cloudy,Rainyのいずれかを入力してください。')
p03380
s804692733
Accepted
n = int(input()) lis = list(map(int,input().split())) lis.sort() ans1 = lis[-1] lis = lis[:-1] half = ans1/2 ans2 = 0 length = 10**9+7 for i in lis: t = abs(half - i) if t < length: length = t ans2 = i print(ans1, ans2)
p03285
s498347114
Wrong Answer
N = int(input()) if N >= 4: if N % 4 == 0: print("Yes") elif N % 4 == 3: print("Yes") else: print("No") else: print("No")
p03109
s721390732
Accepted
S = input() N = int(S[5]) * 10 + int(S[6]) print("Heisei" if N <= 4 else "TBD")
p03624
s213987699
Wrong Answer
import string s = input() lall = [chr(i) for i in range(97, 97+26)] #print(lall) for x in lall: if x not in s: print(x) break
p02615
s682739699
Accepted
import math def resolve(): n = int(input()) values = list(map(int, input().split(' '))) values.sort(reverse=True) ans = 0 for i in range(1, n): ans += values[math.floor(i / 2)] print(ans) resolve()
p03472
s583783917
Accepted
import sys input = sys.stdin.readline N, H = map(int, input().split()) AB = [tuple(map(int, input().split())) for _ in range(N)] tmp = 0 for a, b in AB: tmp = max(tmp, a) AB.sort(key = lambda x: x[1], reverse = True) count = 0 for a, b, in AB: if b > tmp: H -= b count += 1 if H <= 0:...
p02747
s067524929
Accepted
s = input() ans = True while len(s) > 0: if len(s) == 1: print('No') exit(0) if s[0] == 'h' and s[1] == 'i': s = s[2:] else: ans = False break if ans: print('Yes') else: print('No')
p04031
s788831026
Accepted
def main(): n=int(input()) num = list(map(int,input().split())) ave=round(sum(num)/len(num)) ans=0 for i in range(0,len(num)): ans+=(ave-num[i])*(ave-num[i]) print(ans) main()
p02797
s176057522
Accepted
n,k,s = map(int,input().split()) o = 10 ** 9 if s == 10 ** 9: o = 1 res = [s] * k + [o] * (n - k) print(*res)
p03017
s351526146
Accepted
N, A, B, C, D = map(lambda x: int(x) - 1, input().split()) S = input() if C < D: if "##" in S[A: D + 1]: print("No") else: print("Yes") else: if "##" in S[A: D + 1] or not("..." in S[B - 1: D + 2]): print("No") else: print("Yes")
p03000
s102363571
Accepted
n,x=map(int,input().split()) l=list(map(int,input().split())) tmp=0 ans=1 for i in range(n): tmp+=l[i] if tmp<=x: ans+=1 print(ans)
p04045
s407249706
Accepted
n, k = map(int, input().split()) d = set(map(int, input().split())) while True: str_n = str(n) hantei = 1 for i in range(len(str_n)): if int(str_n[i]) in d: hantei = 0 if hantei == 1: break n += 1 print(n)
p02615
s416157805
Accepted
n=int(input()) a=list(map(int, input().split())) new=a+a new=sorted(new, reverse=True) ans=0 for i in range(1, n): ans+=new[i] print(ans)
p02595
s437646927
Wrong Answer
import math N,D = map(int,input().split()) A = [list(map(int, input().split())) for i in range(N)] count = 0 for i in range(N-1): a = math.sqrt((A[i][0]**2+(A[i][1])**2)) if a <= D: count += 1 print(count)
p03493
s033721449
Wrong Answer
num = int(input()) a = num // 100 b = num // 10 - (a * 10) c = num - (a * 100) - (b * 10) print(num) print(a, b, c)
p02684
s685913132
Wrong Answer
N, K = map(int, input().split()) A = list(map(int, input().split())) for i in range(N): A[i] -= 1 loop_lis = [0] visited = [0 for _ in range(N)] visited[0] = 1 loop_time = 0 start_loop = 0 for i in range(K): if visited[A[loop_lis[-1]]] != 0: loop_time = (i+2)-(visited[A[loop_lis[-1]]]) start_loop = i+1 - ...
p03289
s386932531
Accepted
S = input() if S[0] == "A": count = 0 S2 = S[2:-1] for i in S2: if i == "C": count += 1 if count == 1: S3 = S[1:].replace("C","") if S3.islower(): print("AC") exit() print("WA")
p02972
s810359263
Accepted
n = int(input()) a = list(map(int, input().split())) b = [0]*n bon = [] for i in range(n): ri = n - i - 1 if sum(b[ri::ri+1]) % 2 != a[ri]: b[ri] = 1 bon.append(ri+1) print(len(bon)) print(*bon)
p03774
s744730730
Wrong Answer
N, M = map(int, input().split()) ab = [tuple(map(int, input().split())) for i in range(N)] cd = [tuple(map(int, input().split())) for i in range(M)] for a, b in ab: ret = 0 dis = 10**20 for i, x in enumerate(cd): c, d = x if dis > (c-a)**2 + (d-b)**2: dis = (c-a)**2 + (d-b)**2...
p03633
s077816550
Accepted
def gcd(a,b): if a < b: a,b = b,a if b != 0: return gcd(b,a%b) return a def solve(n,ts): a = ts[0] for i in range(n): b = ts[i] c = gcd(a,b) a = a*b//c return a if __name__ == '__main__': n = int(input()) ts = [int(input()) for i in range(n)] ...
p03001
s361868649
Accepted
W,H,x,y = map(int,input().split()) if x == W/2 and y == H/2: ans = 1 else: ans = 0 print(W*H/2,ans)
p03779
s348279283
Wrong Answer
x = int(input()) a = 0 for i in range(1,10*10): a += i if a >= x : print(i) break
p02548
s867801237
Accepted
#!/usr/bin/env python import math n = int(input()) ans = 0 for i in range(1, n): if n%i == 0: ans += n//i-1 else: ans += n//i print(ans)
p02787
s998224023
Accepted
H,N=map(int,input().split()) A=[] B=[] for i in range(N): a,b=map(int,input().split()) A.append(a) B.append(b) DP=[[0]*(H+max(A)) for i in range(N)] DP.insert(0,[10**8+1]*(H+max(A))) DP[0][0]=0 for i in range(1,N+1): for j in range(1,H+1): if j-A[i-1]>0: DP[i][j]=min(DP[i-1][j],DP[i][j-A[i-...
p02659
s123808799
Wrong Answer
A, B = map(str, input().split()) B = float(B) A = int(A) import math a = A*B a = math.floor(a) print(a)
p03814
s174259987
Accepted
s = str(input()) for i in range(len(s)): if s[i] == 'A': start = i break for i in range(len(s)): if s[len(s)-1-i] == 'Z': stop = len(s)-i break ans = stop-start print(ans)
p02823
s697939059
Accepted
N, A, B = map(int, input().split()) diff = B - A if diff % 2 == 0: print(diff // 2) else: print(min(A - 1, N - B) + 1 + ((diff - 1) // 2))
p02623
s674195428
Wrong Answer
n,m,k = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) c = [0] d = 0 for i in range(n): d += a[i] c.append(d) e = [0] f = 0 for i in range(m): f += b[i] e.append(f) ans = 0 j = m for i in range(n): if c[i] > k: break else: wh...
p03471
s533113057
Wrong Answer
all = list(map(int, input().split())) N = all[0] Y = all[1] check = 0 for i in range(N): for j in range(N-i): total = 10000*i + 5000*j + 1000*(N-(i+j)) if Y!=total: continue else: yu = i hi = j no = (N-(i+j)) check += 1 if check=...
p02631
s102772038
Accepted
from collections import defaultdict it = lambda: list(map(int, input().strip().split())) INF = float('inf') def solve(): N = int(input()) X = it() a = 0 for x in X: a = a ^ x ans = '' for x in X: ans += str(x ^ a) + ' ' print(ans) if __name__ == '__main__': solve(...
p02761
s902634544
Accepted
# C #C N, M = map(int, input().split()) sc = {i+1:[] for i in range(N)} for _ in range(M): si, ci = map(int, input().split()) sc[si] += [ci] sc = {k:list(set(v)) for k,v in sc.items()} flag = True if N>1 and 0 in sc[1]: flag = False for v in sc.values(): if len(v)>1: flag = False ans = -1 if flag:...
p03611
s378410623
Accepted
N, *A = map(int, open(0).read().split()) C = {} for a in A: if a in C.keys(): C[a] += 1 else: C[a] = 1 B = list(C.items()) B.sort(key=lambda x: x[0]) M = len(B) ans = 0 for i in range(M): count = B[i][1] if i-1 >= 0 and B[i-1][0] == B[i][0]-1: count += B[i-1][1] if i+1 < M ...
p02624
s768592254
Wrong Answer
n = int(input()) ans = 0 for i in range(1,n): k = n//i ans += i*(k*(k+1)//2) print(ans)
p03073
s954805168
Accepted
S = input() ans = 0 if S[0]=="0": ans += S[0::2].count("1") ans += S[1::2].count("0") else: ans += S[0::2].count("0") ans += S[1::2].count("1") print(ans)
p02748
s738009287
Accepted
A,B,M = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) ans = min(a)+min(b) for i in range(M): x,y,c = map(int,input().split()) ans = min(ans,a[x-1]+b[y-1]-c) print(ans)
p03481
s182607152
Accepted
x,y=map(int,input().split()) cnt=0 num=x while(num<=y): num*=2 cnt+=1 print(cnt)
p02779
s425497435
Accepted
def solve(n, a_list): if len(set(a_list)) == n: return "YES" else: return "NO" def main(): n = int(input()) a_list = list(map(int, input().split())) res = solve(n, a_list) print(res) def test(): assert solve(5, [2, 6, 1, 4, 5]) == "YES" assert solve(6, [4, 1, 3, 1, 6,...
p02556
s577663989
Wrong Answer
n=int(input()) m=0 t1,t2=map(int,input().split()) for i in range(n-1): x,y=map(int,input().split()) xn=(x-t1) yn=(y-t2) if xn<0: xn=xn*(-1) if yn<0: yn=yn*(-1) l=xn+yn t1=x t2=y if l>m: m=l print(m)
p02658
s756599668
Accepted
N = int(input()) A = list(map(int, input().split())) result = 1 if 0 in A: print(0) else: for i in range(N): result *= A[i] if result > 10**18: print(-1) quit() print(result)
p02946
s217314764
Accepted
k, x = map(int, input().split()) s = x - k + 1 e = x + k - 1 list = [] for i in range(s, e +1): list.append(i) print(*list)
p03799
s336144133
Accepted
''' Created on 2020/08/28 @author: harurun ''' def main(): import sys pin=sys.stdin.readline pout=sys.stdout.write perr=sys.stderr.write N,M=map(int,pin().split()) if 2*N>M: print(M//2) else: print(N+((M-2*N)//4)) return main()
p02759
s676961530
Wrong Answer
N=int(input()) if(N%2==0): print(N/2) else: print(N//2+1)
p03478
s801919911
Accepted
N, A, B=map(int, input().split()) def fun(x): s=list(str(x)) wa=0 for p in s: wa+=int(p) return wa ans=0 for i in range(1,N+1): tmp=fun(i) if A<=tmp and tmp<=B: ans+=i print(ans)
p03434
s437762659
Accepted
url = "https://atcoder.jp/contests/abc088/tasks/abc088_b" def main(): g = input() lis = list(map(int, input().split())) lis.sort(reverse=True) a = 0 b = 0 for i in range(len(lis)): if i % 2 == 0: a += lis[i] else: b += lis[i] print(a - b) if __name_...
p03061
s505378258
Wrong Answer
from math import gcd n=int(input()) a=list(map(int,input().split())) if n==2: print(max(a)) exit() a.sort() pin=a[0] pin2=a[1] lst=[] lst2=[] for i in a: lst.append(gcd(pin,i)) lst2.append(gcd(pin2,i)) lst.sort() lst2.sort() print(max(lst[1],lst2[1]))
p02797
s555980667
Accepted
def main(): length, sum_num, subarray_sum = map(int, input().split()) answer = [subarray_sum] * sum_num if subarray_sum == 10 ** 9: answer += [1] * (length - sum_num) else: answer += [subarray_sum + 1] * (length - sum_num) print(" ".join(map(str, answer))) if __name__ == '__main__'...
p02765
s149896581
Wrong Answer
a,b=map(int,input().split()) if a>=10: print(b) else: print(b+100*(10-b))
p03548
s936117237
Wrong Answer
X,Y,Z=map(int,input().split()) for i in range((X//Y)+1): if X<(i*Y+(i+1)*Z): print(i-1) break
p02993
s347147387
Wrong Answer
S = input() if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]: print("Bad") else: print("Yes")
p02642
s881831859
Wrong Answer
N = int(input()) A = list(map(int, input().split())) K = {} A.sort() before = -1 for i in A: c = 2 if before == i: K[i] = 1 while(True): if i*c > 2*(10**5): break K[i*c] = 1 c += 1 before = i t = 0 for i in A: if i in K: t += 1 print(N-t)
p02820
s382148436
Wrong Answer
n,k=map(int,input().split()) r,s,p=map(int,input().split()) t = input() d = [0]*3*10**5 for i in range(n): if t[i] == 'r': d[i] = 2*10**4+p if t[i] == 's': d[i] = 4*10**4+r if t[i] == 'p': d[i] = 6*10**4+s ans = 0 for i in range(n): if d[i] == d[k+i]: d[k+i] = 0 ans += d[i]%(10**4) print(ans)
p02647
s686240873
Accepted
n, k = map(int, input().split()) a = list(map(int, input().split())) for _ in range(k): tmp = [0] * (n + 1) for i in range(n): tmp[max(0, i - a[i])] += 1 tmp[min(n, i + a[i] + 1)] -= 1 for i in range(n): a[i] = tmp[i] tmp[i + 1] += tmp[i] if min(a) == n: break p...
p02664
s516720099
Wrong Answer
def main(): s = list(input()) for i in range(len(s)): if i == 0 and s[0] == "?": s[0] = "P" elif s[i] == "?": s[i] = "D" print(*s, sep="") if __name__ == "__main__": main()
p03435
s243219709
Accepted
c11, c12, c13 = map(int, input().split()) c21, c22, c23 = map(int, input().split()) c31, c32, c33 = map(int, input().split()) diff1 = c21 - c11 diff2 = c31 - c21 if diff1 == (c22-c12) and diff2 == (c32-c22) and diff1 == (c23-c13) and diff2 == (c33-c23): print("Yes") else: print("No")
p03543
s706498101
Accepted
# -*- coding: utf-8 -*- n = list(str(input())) if n[0:3].count(n[0]) == 3 or n[1:].count(n[1]) == 3: print('Yes') else: print('No')
p03427
s983317240
Wrong Answer
# A N = input() N_i = int(N) N_s = list(N) for i in range(0,17): if N_i < 10 ** i: break flag = True for j in range(0,i-1): if N_s[j] != "9": flag = False break if flag == True: # 最上位を除いたすべての桁が9 print(int(N_s[0])+9*(len(N_s)-1)) else: print(int(N_s[0])+9*(len(N_s)-1)-1)
p03309
s997731406
Accepted
n=int(input()) A=list(map(int,input().split())) for i in range(n): A[i]-=i+1 A.sort() c=A[n//2] ans=0 for a in A: ans+=abs(a-c) print(ans)
p03387
s353148826
Accepted
a,b,c=map(int,input().split()) x=max(a,b,c) y=min(a,b,c) z=a+b+c-x-y if (z-y)%2==0: print(x-z+(z-y)//2) else: print(x-z+1+(z-y+1)//2)
p03041
s176465040
Accepted
def main(): n,k = map(int,input().split()) s = list(input()) s[k - 1] = chr(ord(s[k - 1]) + 32) t = '' for i in s: t = t + i print(t) main()
p02947
s716990018
Accepted
from collections import defaultdict from collections import deque from collections import Counter import itertools import math def readInt(): return int(input()) def readInts(): return list(map(int, input().split())) def readChar(): return input() def readChars(): return input().split() n = readInt() d = defa...
p02963
s283019841
Wrong Answer
# x2y3 - y2x3 = S s = int(input()) if s == 10**19: print(0, 0, 10**9, 10**9, 0, 10**9) exit() x_2 = 10**9 x_3 = 10**9 - s%(10**9) y_2 = 1 y_3 = s//(10**9) + 1 print(0, 0, x_2, x_3, y_2, y_3)
p03632
s480055822
Accepted
import math import calendar import fractions import itertools a, b, c, d = map(int, input().split()) if c < a: if d < a: print(0) elif a <= d <= b: print(d - a) else: print(b - a) elif a <= c <= b: print(min(d - c, b - c)) else: print(0)
p02957
s050059995
Accepted
a, x =map(int, input().split()) if (a+x)%2 ==0: print(int((a+x)/2)) else: print('IMPOSSIBLE')
p02723
s030969292
Wrong Answer
S = input("") if len(S)<6: print("If S is coffee-like, print 'Yes';") else: if ((S[2]) == (S[3])): if ((S[4]) == (S[5])): if S.islower(): print ("Yes") else: print ("No") else: print("No")
p02861
s812576587
Accepted
import itertools import math n = int(input()) X = [[] for _ in range(n)] Y = [[] for _ in range(n)] for i in range(n): X[i], Y[i] = map(int, input().split()) Dist = [0 for _ in range(math.factorial(n))] for i, S in enumerate(itertools.permutations(range(n))): for j in range(len(S) - 1): Dist[i] += ((...
p02957
s259927681
Accepted
a, b = map(int, input().split()) k = (a * a - b * b) / (2 * a - 2 * b) if k == int(k): print(int(k)) else: print('IMPOSSIBLE')
p03699
s470707399
Wrong Answer
N = int(input()) def get_max(nums): for num in nums: if num % 10 != 0: return num return 0 # accumulateは使わない scores = sorted([int(input()) for i in range(N)])[::-1] accum = [scores[0]] # 降順になったscoresで数字を足し込んでいく(後半になるほど増加分を少なくする) for i in range(1, N): accum.append(accum[i-1] + scores[...
p02879
s495602694
Accepted
A,B = map(int,input().split()) if A > 9 or B > 9: print("-1") else: print(str(A * B))
p02838
s906431783
Accepted
N = int(input()) A = tuple(map(int, input().split())) MOD = 10**9+7 arr = [0] * 60 for a in A: for i in range(60): if a>>i & 1: arr[59-i] += 1 ans = 0 for i, a in enumerate(arr): b = N - a ans += (a*b) * (2**(59-i)) ans %= MOD print(ans)
p02957
s817468088
Accepted
import sys a, b = map(int, sys.stdin.readline().split()) def main(): c = a + b return 'IMPOSSIBLE' if c & 1 else c // 2 if __name__ == '__main__': ans = main() print(ans)
p03645
s276489030
Wrong Answer
n, m = map(int, input().split()) d = {} for i in range(1,n): d[i] = 0 for _ in range(m): a, b = map(int, input().split()) if d[a] < b: d[a] = b if d[d[1]] == n: print("POSSIBLE") else: print("IMPOSSIBLE")
p02778
s751397882
Accepted
s = input() a = "" for i in range(len(s)): a += "x" print(a)
p02688
s732365836
Accepted
N, K = [int(i) for i in input().split()] cnt = 0 sunuke_dict = {} for i in range(1, N+1): sunuke_dict[i] = 0 while cnt < K: cnt += 1 d = int(input()) sunuke_list = [int(i) for i in input().split()] for sunuke in sunuke_list: sunuke_dict[sunuke] = 1 result = [key for key, value in sunuk...
p02584
s447373583
Wrong Answer
# -*- coding: utf-8 -*- x,k,d=map(int,input().split()) x+=d*k m=abs(x) for i in range(k+1): x-=d*2 if i==k: print(m) else: if abs(x)<m: m=abs(x) else: print(m)