problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02873
s330840757
Accepted
S = input() a = [0] * (len(S) + 1) for i in range(len(S)): if S[i] == "<": a[i + 1] = a[i] + 1 for i in list(range(len(S)))[::-1]: if S[i] == ">" and a[i + 1] >= a[i]: a[i] = a[i + 1] + 1 print(sum(a))
p02622
s693899836
Accepted
s = input() t = input() counter = 0 for i in range(0, len(s)): if s[i] != t[i]: counter += 1 print(counter)
p03416
s158948460
Accepted
A,B = [int(i) for i in input().split()] c = 0 for n in range(A,B+1): c += str(n) == str(n)[::-1] print(c)
p03951
s947153383
Wrong Answer
n = int(input()) s = input() t = input() tyouhuku = 0 for i in range(n): if s[i:]==t[:n-i]: tyouhuku = n-i print(max(n,2*n-tyouhuku))
p02784
s847587971
Wrong Answer
import numpy as np H, N = map(int, input().split()) x = list(map(int, input().split())) win = 0 for i in range(N): for j in range(i+1, N): if x[i] + x[j] >= H: win = 1 print("Yes") break if win == 1: break if win == 0: print("No")
p02690
s907758229
Wrong Answer
X = int(input()) for a in range(0, 10**9): bb = X - a**5 B = bb**0.2 if isinstance(B, float): if B.is_integer(): print(a, int(B)) break a *= -1 bb = X - a**5 B = bb**0.2 if isinstance(B, float): if B.is_integer(): print(a, int(B)) break
p02790
s654151925
Accepted
n, m = map(int, input().split()) if(n>m):print(str(m)*n) else:print(str(n)*m)
p02910
s484948102
Accepted
s = input() answer = 'Yes' for i in range(len(s)): if i%2 == 0: if s[i] == 'L': answer = 'No' break else: if s[i] == 'R': answer = 'No' break print(answer)
p02916
s515609089
Accepted
N = int(input()) A = [-1] + [int(x) for x in input().split()] B = [0] + [int(x) for x in input().split()] C = [0] + [int(x) for x in input().split()] ans = 0 for i in range(1, N + 1): ans += B[A[i]] if A[i] == A[i - 1] + 1: ans += C[A[i - 1]] print(ans)
p03730
s705433627
Accepted
a, b, c = map(int, input().split()) ans = 'NO' if a < b and c%a == 0: ans = 'YES' else: for i in range(1, 10000): if (b*i + c)%a == 0: ans = 'YES' break print(ans)
p02993
s630119889
Accepted
S=str(input()) if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]: print('Bad') else: print('Good')
p02772
s585859680
Accepted
n = input() a = list(map(int, input().split())) ans = True for x in a: if x % 2 == 0: if not(x % 3 == 0 or x % 5 == 0): ans = False break print('APPROVED') if ans else print('DENIED')
p02723
s877290054
Wrong Answer
s=[] s=input() if str.islower(s)==True and s[2]==s[3] and s[4]==s[5] and s[3]!=s[4] and s[0]!=s[1] and s[1]!=s[2]: print("Yes") else: print("No")
p02570
s949743992
Accepted
from collections import defaultdict from collections import deque from collections import Counter import math def readInt(): return int(input()) def readInts(): return list(map(int, input().split())) def readChar(): return input() def readChars(): return input().split() d,t,s = readInts() if d<=t*s: print("Yes") else: print("No")
p02795
s412034343
Accepted
h=int(input()) w=int(input()) n=int(input()) a=max(h,w) count=1 while a*count<n: count+=1 print(min(count,h,w))
p02994
s172530141
Accepted
n,l=map(int,input().split()) aji = [l+i for i in range(n)] ans = None sa=10**10 for i in range(n): sa_tmp=abs(aji[i]) if sa>sa_tmp: sa=sa_tmp ans=sum(aji)-aji[i] print(ans)
p03617
s813308348
Wrong Answer
a = list(map(int, input().split())) n = int(input()) a[0] *= 8 a[1] *= 4 a[2] *= 2 if n % 2 == 0: val = min(a) print((n//2)*val) else: val = min(a[:3]) if n > 2 and val > a[-1]: print(int((n//2)*a[-1]+val/2)) else: print(int(n*val/2))
p02882
s711194930
Wrong Answer
import math inp = list(map(int,input().split())) a=inp[0] b=inp[1] x=inp[2] k=(2*(a*a*b-x))/(a**3) print (math.atan(k))
p02708
s053279724
Wrong Answer
n,k=map(int,input().split()) print((n+1)*(k+n+1)*(n+2-k)//2+k*(k-1)*(2*k-1)//6-(n+2)*(n+1)*(2*n+3)//6+n+2-k)
p03665
s608487622
Accepted
n, p = map(int,input().split()) a = list(map(int,input().split())) o = 0 for i in a: if i % 2: o += 1 e = n-o if o != 0: print((2**e)*int(2**(o-1))) else: if p == 0: print(2**n) else: print(0)
p03379
s301296690
Accepted
N = int(input()) Xls = list(map(int,input().split())) X2ls = sorted(Xls) M1 = X2ls[N//2-1] M2 = X2ls[N//2] lsans = [] for i in range(N): if Xls[i] <= M1: M = M2 else: M = M1 lsans.append(M) for i in lsans: print(i)
p03730
s557238049
Accepted
a,b,c=map(int,input().split()) q=1 for i in range(b): if a*i%b==c: q=0 break if q==0: print("YES") else: print("NO")
p03611
s396097663
Accepted
import numpy as np n = int(input()) a_ls = list(map(int, input().split())) # -1, 0, 右端も用意 updown_ls = [0] * (10**5 + 3) for i in range(n): left = a_ls[i] right = a_ls[i] + 3 updown_ls[left] += 1 updown_ls[right] -= 1 updown_ls.pop() num_ls = list(np.cumsum(updown_ls)) print(max(num_ls))
p03210
s906540924
Wrong Answer
x = int(input()) if x == 3 or 5 or 7: print("YES") else: print("NO")
p03723
s333451941
Accepted
A,B,C = map(int,input().split()) if A%2 != 0 or B%2 != 0 or C%2 != 0: print(0) exit() if A*2 == B+C and B*2 == A+C and C*2 == A+B: print(-1) exit() ans = 0 for i in range(10000): a = A//2 b = B//2 c = C//2 if A%2 == 0 and B%2 == 0 and C%2 == 0: ans += 1 A = b+c B = a+c C = a+b else: print(ans) exit()
p03327
s736681451
Accepted
# ABC 099: A – ABD n = int(input()) print('ABC' if n < 1000 else 'ABD')
p02787
s855900847
Accepted
INF = 10**9 H, N = map(int, input().split()) AB = [list(map(int, input().split())) for _ in range(N)] dp = [INF for i in range(H+1)] dp[0] = 0 for i in range(N): a = AB[i][0] b = AB[i][1] for j in range(H+1): next_j = min(j+a, H) dp[next_j] = min(dp[next_j], dp[j]+b) print(dp[H])
p03672
s359470739
Accepted
S = input() ans = 0 for i in range(1, len(S)): s = S[: -2*i] l = (len(S) - 2*i) // 2 if s[:l] == s[l:]: ans = len(S) - 2*i break print(ans)
p04019
s480591534
Accepted
S = input() if 'N' in S or 'S' in S: if 'S' not in S or 'N' not in S: print('No') exit() if 'E' in S or 'W' in S: if 'W' not in S or 'E' not in S: print('No') exit() print('Yes')
p03723
s805175233
Accepted
a, b, c = map(int, input().split()) if a == b == c and a%2 == 0: print(-1) elif a%2 or b%2 or c%2: print(0) else: ans = 0 while a%2 == b%2 == c%2 == 0: a, b, c = (b+c)//2, (a+c)//2, (a+b)//2 ans += 1 print(ans)
p03073
s287629831
Wrong Answer
s = input() cnt1 = 0 cnt2 = 0 for i in range(len(s)): if i%2 == 0: if s[i] == "0": cnt1 += 1 else: cnt2 += 1 else: if s[i] == "1": cnt2 += 1 else: cnt1 += 1 print(min(cnt1,cnt2))
p03262
s697779484
Wrong Answer
import fractions a,b= list(map(int, input().split())) i= list(map(int, input().split())) ans=0 l=[] for j in range(a): l.append(abs(b-i[j])) for k in range(1,a): if k==1: ans=abs(l[1]-l[0]) else: ans=fractions.gcd(ans,abs(l[k]-l[k-1])) print(ans)
p02795
s853488839
Wrong Answer
h = int(input()) w = int(input()) n = int(input()) print(n // max(h, w))
p02880
s937307257
Wrong Answer
N = int(input()) count = 0 for i in range(2, 10): if N%i == 0 and N//i <= 9: count += 1 print("Yes") if count >0 else print("No")
p02897
s266851126
Wrong Answer
n = int(input()) print(n//2 / n)
p02754
s143955414
Accepted
n,a,b = map(int,input().split()) saaa = a+b s1 = n//saaa nokori = n%saaa if nokori >= a: nokori = a else: nokori = nokori ans = s1*a + nokori print(ans)
p03624
s580979263
Wrong Answer
s=sorted(set(input())) ro='abcdefghijklmnopqrstuvwxyz' if len(s)==len(ro): print('None') else: for i in range(len(s)): if s[i]!=ro[i]: print(ro[i]) break if s[-1]!=ro[len(ro)-1]: print('z') break
p02664
s856961757
Wrong Answer
def main(): t = input() s = t.replace('?D', 'PD').replace('??', 'PD').replace('?', 'D') print(s) if __name__ == '__main__': main()
p03761
s569726676
Wrong Answer
# coding: utf-8 from collections import Counter alp = "abcdefghijklmnopqrstyvwxyz" S = [] count = {} for a in alp: count[a] = 51 N = int(input()) for i in range(N): s = input() S.append(s[:]) ans = "" for a in alp: cnt = 0 min_ = 10**9 for s in S: if a in s: cnt += 1 min_ = min(min_, s.count(a)) if cnt == N: ans += a * min_ print(ans)
p03659
s851575753
Accepted
n = int(input()) li = list(map(int,input().split())) from itertools import accumulate lin = list(accumulate(li)) mi = 10**18 S = sum(li) for i in range(n-1): ara = lin[i] sunu = S-ara mi = min(mi,abs(ara-sunu)) print(mi)
p02743
s674209506
Accepted
from decimal import * getcontext().prec = 30000 a, b, c = map(int, input().split()) #print(a **.5, b**.5,c**.5) #print(a **.5+ b**.5,c**.5) #print(Decimal(a).sqrt() , Decimal(b).sqrt() , Decimal(c).sqrt()) #if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt(): if 2 * Decimal(a * b).sqrt() + Decimal(b) + Decimal(a) < Decimal(c): #if a **.5 + b**.5 < c**.5: print('Yes') else: print('No')
p03548
s864107295
Accepted
X,Y,Z=map(int,input().split()) print(int((X-Z)/(Z+Y)))
p03289
s057347993
Wrong Answer
import sys S=input() first=S[0] last=S[len(S)-1] cnt=0 moji=[i for i in "abcdefghijklmnopqrstuvwxyz"] # print(len(moji)) if first=="A": for i in range(2,len(S)-1): if S[i]=="C": cnt+=1 else: if (S[i] in moji)==False: print("WA") sys.exit() if cnt==1 and ((last in moji)==True): print("AC") else: print("WA") else: print("WA")
p02765
s005967927
Accepted
import sys readline = sys.stdin.readline N, R = map(int, readline().split()) ans = None if N >= 10: ans = R else: ans = R + 100*(10 - N) print(ans)
p02787
s288003928
Accepted
def main(): import sys readline = sys.stdin.readline # readlines = sys.stdin.readlines H, N = map(int, input().split()) M = [tuple(map(int, readline().split())) for _ in range(N)] INF = float('inf') dp = [INF] * (H + 1) dp[0] = 0 for i in range(N): a, b = M[i] for j in range(H): nj = min(H, j + a) dp[nj] = min(dp[nj], dp[j] + b) print(dp[H]) if __name__ == "__main__": main()
p02693
s724866477
Wrong Answer
k = int(input()) a,b = map(int, input().split()) c = b-a for i in range(c, b+1): if i % k == 0: print('OK') break else: print("NG")
p02646
s872769185
Accepted
a, v = map(int, input().split()) b, w = map(int, input().split()) t = int(input()) L = abs(a - b) s = v - w if s <= 0 or L / s > t: result = "NO" else: result = "YES" print(result)
p02829
s189162869
Accepted
def main(): ans = [1, 2, 3] a = int(input()) b = int(input()) ans.remove(a) ans.remove(b) print(ans[0]) main()
p03659
s227705712
Accepted
n = int(input()) a = list(map(int, input().split())) import itertools accum = list(itertools.accumulate(a)) ans = float('inf') for i in range(n-1): ans = min(ans, abs((accum[-1] - accum[i]) - accum[i])) print(ans)
p03524
s462265393
Wrong Answer
""" 2ζ–‡ε­— or 3ζ–‡ε­—γ γ‘οΌŸ aa bb cc δΊŒζ–‡ε­—δΈ¦γ°γͺγ„γ‚ˆγ†γ«δΈ¦γ³ζ›Ώγˆγ‚‹ """ S = input() na = S.count("a") nb = S.count("b") nc = S.count("c") nall = na+nb+nc mx = max(na,nb,nc) mn = min(na,nb,nc) rest = nall - mx if len(S) == 3 and mx == 2 and mn == 0: print("NO") else: if mx - rest >= 2: print("NO") else: print("YES")
p02843
s299353071
Accepted
ni = lambda: int(input()) nm = lambda: map(int, input().split()) nl = lambda: list(map(int, input().split())) from math import ceil x=ni() p=x%100 if ceil(p/5) <= x//100: print(1) else: print(0)
p02983
s986844887
Accepted
#!/usr/bin/env python3 L, R = map(int, input().split()) l = L % 2019 r = R % 2019 if R - L < 2019 and r > l: print( min(i * j % 2019 for i in range(l, r + 1) for j in range(i + 1, r + 1))) else: print(0)
p02718
s895618073
Accepted
first_input = list(map(lambda x:int(x), input().split(" "))) second_input = list(map(lambda x:int(x), input().split(" "))) second_input.sort(reverse=True) criteria = sum(second_input)/float(4*first_input[1]) count = 0 for i in range(len(second_input)): if second_input[i]>=criteria: count = count+1 else: break if count >= first_input[1]: print("Yes") else: print("No")
p02835
s772553756
Accepted
a,b,c=map(int,input().split()) if a+b+c>=22: print("bust") else: print("win")
p03821
s121438384
Accepted
n = int(input()) ab = [list(map(int, input().split())) for i in range(n)][::-1] ans = 0 for a, b in ab: a += ans if a % b != 0: ans += b - a % b print(ans)
p02621
s172999926
Accepted
def resolve(): import sys input = sys.stdin.readline n = int(input().rstrip()) print(n + n*n + n*n*n) if __name__ == "__main__": resolve()
p02615
s890776132
Wrong Answer
n = int(input()) A = input() A = A.split() A = [int(i) for i in A] A = sorted(A, reverse = True) ans = 0 for x in A: ans += x ans -= A[n-1] print(ans)
p03345
s640057679
Wrong Answer
A, B, C, K = map(int, input().split()) if K == 0: print(A-B) exit() A, B, C = B+C, C+A, A+B if abs(A-B) > 10**18: print('Unfair') else: print(A-B)
p03475
s675831554
Wrong Answer
n = int(input()) t = [0 for i in range(n)] for i in range(n-1): c,s,f = map(int,input().split()) for j in range(i+1): if t[j] <= s: t[j] = c + s elif t[j] % f: t[j] += c else: t[j] += f - (t[j] % f) for i in t: print(i)
p03644
s676618697
Accepted
N = int(input()) n = 1 while n*2 <= N: n *= 2 print(n)
p02818
s909954257
Accepted
a, b, k = map(int, input().split()) if a >= k: print(a-k, b) else: if b - (k-a) >= 0: print(0, b - (k-a)) else: print(0, 0)
p03835
s849823598
Accepted
k,s = map(int,input().split()) c = 0 for i in range(k+1): for j in range(k+1): #print(i,j) if (s - (i + j)) <= k and (i + j) <= s: c += 1 print(c)
p02879
s255657693
Wrong Answer
from sys import stdin A, B = [int(x) for x in stdin.readline().rstrip().split()] if A*B <= 81: print(A*B) else: print(-1)
p03680
s147881564
Accepted
N = int(input()) a = [int(input()) for _ in range(N)] count = 0 i = 1 for _ in range(N): i = a[i-1] count += 1 if i == 2: print(count) break else: print(-1)
p02744
s948196368
Wrong Answer
import string def dfs(w): if len(w) == N: print(w) return for i in range(N): dfs(w + string.ascii_lowercase[i]) N = int(input()) anslst = [] nlst = [0] * N wordlst = string.ascii_lowercase dfs('a')
p02760
s610503003
Accepted
x1=list(map(int,input().split())) x2=list(map(int,input().split())) x3=list(map(int,input().split())) n=int(input()) for _ in range(n): m=int(input()) x1 =[0 if m==x else x for x in x1] x2 =[0 if m==x else x for x in x2] x3 =[0 if m==x else x for x in x3] if sum(x1)*sum(x2)*sum(x3) ==0 or x1[0]+x2[0]+x3[0]==0 or x1[1]+x2[1]+x3[1]==0 or x1[2]+x2[2]+x3[2]==0 or x1[0]+x2[1]+x3[2]==0 or x1[2]+x2[1]+x3[0]==0: print("Yes") else: print("No")
p02624
s188834474
Accepted
def main(): N = int(input()) ans = 0 for X in range(1, N + 1): Y = N // X ans += Y * (Y + 1) * X // 2 print(ans) if __name__ == '__main__': main() exit()
p03086
s065598363
Wrong Answer
import itertools S = list(input()) Idxs = list(itertools.combinations(range(len(S)), 2)) def ACGT(Word): for w in Word: if w not in ["A", "C", "G", "T"]: return 0 return len(Word) ans = 0 for s in S: if s in ["A", "C", "G", "T"]: ans = 1 break for idx in Idxs: tmp = S[idx[0]:idx[1]] ans = max(ans, ACGT(tmp)) print(ans)
p02600
s080920231
Accepted
def tmp(n): if n >= 1800 and n < 2000: return 1 elif n >= 1600 and n < 1800: return 2 elif n >= 1400 and n < 1600: return 3 elif n >= 1200 and n < 1400: return 4 elif n >= 1000 and n < 1200: return 5 elif n >= 800 and n < 1000: return 6 elif n >= 600 and n < 800: return 7 elif n >= 400 and n < 600: return 8 n = int(input()) print(tmp(n))
p02829
s207796417
Accepted
a = [int(input())] b = [int(input())] l = [1, 2, 3] ans = set(l) - set(a) -set(b) print(list(ans)[0])
p02888
s348590308
Wrong Answer
from bisect import * n = int(input()) l = sorted(list(map(int, input().split()))) cnt = 0 for i in range(n): a = l[i] for j in range(i+1, n): b = l[j] lower = bisect_right(l, b) upper = bisect_left(l, a+b) cnt += upper - lower print(cnt)
p03665
s288017112
Accepted
n,p = map(int,input().split()) a = list(map(int,input().split())) odd = [i for i in a if i%2==1] eve = [i for i in a if i%2==0] odd_len = len(odd) eve_len = len(eve) if p==0: ans = 2**eve_len else: ans = 0 count = 0 if p==0: if odd_len!=0: ans *= 2**odd_len//2 else: ans += (2**eve_len)*(2**odd_len//2) print(ans)
p02897
s877663696
Accepted
def main(): n = int(input()) print((n // 2 + n % 2)/n) if __name__ == "__main__": main()
p02796
s674757036
Accepted
import sys input = sys.stdin.readline #ζ–‡ε­—εˆ—ε…₯εŠ›γ§γ―ζ³¨ζ„οΌ from bisect import bisect N = int(input()) XL = [list(map(int,input().split())) for _ in range(N)] S = [] for x,l in XL: S.append([x-l,x+l]) S.sort(key=lambda x: x[1]) ans = 1 mi = S[0][1] for i in range(1,N): if mi <= S[i][0]: mi = S[i][1] ans += 1 print(ans)
p03017
s248527181
Accepted
N,A,B,C,D = map(int,input().split()) S = str(input()) E = max(C,D) AE = S[A:E] BD = S[B-2:D+1] if "##" in AE: print("No") elif C > D and "..." not in BD: print("No") else: print("Yes")
p02988
s870328502
Wrong Answer
n = int(input()) p = list(map(int, input().split())) count=0 for name in range(len(p)-1): if ((p[name+1] > p[name]) and (p[name] > p[name-1])) or ((p[name-1] > p[name])and (p[name] > p[name+1])): count+=1 print(count)
p03371
s311089697
Accepted
#n = int(input()) a, b, c, x, y = map(int, input().split()) #al = list(map(int, input().split())) #al=[list(input()) for i in range(n)] mn = a*x+b*y for i in range(0, max(x, y)+1): mn = min(mn, max(x-i, 0)*a+max(y-i, 0)*b+2*i*c) print(mn)
p04044
s484000613
Accepted
n, y = map(int, input().split()) A = list(map(str, [input() for i in range(n)])) list.sort(A, reverse=False) print(''.join(A))
p03250
s542763719
Wrong Answer
a,b,c=map(int,input().split()) if a>b>c or a>c>b: print(10*a+b+c) elif c>a>b or c>b>a: print(10*c+a+b) else: print(10*b+a+c)
p03456
s298607592
Accepted
def resolve(): import math n = int(input().replace(' ', '')) n = math.sqrt(n) if str(n)[-2:] == '.0': print('Yes') else: print('No') resolve()
p02603
s165399420
Accepted
N = int(input()) A = list(map(int,input().split())) S = 1000 flag = 0 K = 0 for i in range(N-1): if A[i] < A[i+1] and flag == 0: K = S//A[i] S = S - K*A[i] flag = 1 if A[i] > A[i+1] : S += K*A[i] K = 0 flag = 0 S += K*A[N-1] print(S)
p03485
s354629289
Accepted
a, b = map(int, input().split()) print(-(-(a+b)//2))
p02696
s813707863
Wrong Answer
import math a,b,n = map(int,input().split()) temp = a * b // math.gcd(a, b) - 1 temp = min(temp, n) ans = (a * temp)//b - a * (temp//b) print(ans)
p02697
s407638689
Wrong Answer
N, M = map(int, input().split()) num1 = N // 2 num2 = (N // 2) + 1 for i in range(M): print(num1-i, num2+i)
p02577
s285444720
Accepted
N = input() list_num = list(N) A = [int(s) for s in list_num] if sum(A) % 9 == 0: print('Yes') else: print('No')
p03838
s679510880
Wrong Answer
x,y=map(int,input().split()) ans=0 if y==0: if x>0:ans+=1 ans+=abs(x) print(0) if x>0 and y>0: if x<=y: ans+=abs(y-x) else: ans+=abs(y-x)+2 elif (x>0 and y<0) or (x<0 and y>0): ans+=abs(abs(x)-abs(y))+1 elif x<0 and y<0: if x<=y: ans+=abs(y-x) else: ans+=abs(y-x)+2 print(ans)
p02596
s516939275
Accepted
k = int(input()) n = 0 for i in range(1, k+1): n = (n * 10 + 7) % k if n == 0: print(i) exit() print('-1')
p03359
s218280577
Accepted
a, b = map(int, input().split()) print(a) if a <= b else print(a-1)
p02995
s407020289
Accepted
import fractions A, B, C, D = map(int, input().split()) cnt = 0 ac = (A-1) // C bc = B // C ad = (A-1) // D bd = B // D gcd_b = B // (C*D//fractions.gcd(C, D)) gcd_a = (A-1) // (C*D//fractions.gcd(C, D)) total = B - A + 1 a = bc - ac b = bd - ad gcdx = gcd_b - gcd_a print(total-a-b+gcdx)
p02761
s363942341
Accepted
n,m = map(int, input().split()) sc = [list(map(int, input().split())) for _ in range(m)] def check(num): num_str = str(num) if len(num_str) != n: return False for s, c in sc: if num_str[s-1] != str(c): return False return True for i in range(1000): if check(i): print(i) exit() print(-1)
p03437
s068580856
Wrong Answer
from sys import exit X, Y = map(int,input().split()) if X % Y == 0 or Y % X == 0: print(-1) else: for i in range(10 ** 18 + 1): if i % X == 0 and i % Y != 0: print(i) exit()
p02838
s149178327
Accepted
import numpy as np n = int(input()) arr = np.array([int(i) for i in input().split()]) mod = 10 ** 9 + 7 s = 0 for i in range(60): c1 = np.count_nonzero(arr & 1) # θ‡ͺεˆ†γŒnp.sumγ‚’εˆ©η”¨γ—γŸγŒγ©γ†γ—γ¦γ‚‚ζ­£θ§£γ«γͺγ‚Œγͺγ‹γ£γŸγ€‚γͺぜ? s += 2 ** i * c1 * (n - c1) arr >>= 1 print(s % mod)
p02603
s336892055
Accepted
n = int(input()) a = list(map(int, input().split())) stock = 0 prop = 1000 grad = -1 for i in range(n - 1): diff = a[i + 1] - a[i] if grad == -1 and diff > 0: trade_num = prop // a[i] stock = trade_num prop -= (trade_num * a[i]) grad = 1 elif grad == 1 and diff < 0: prop += stock * a[i] stock = 0 grad = -1 if grad == 1: prop += stock * a[n - 1] print(prop)
p03861
s603261546
Accepted
a,b,x = map(int, input().split()) print(b//x - (a+x-1)//x + 1)
p03624
s928872673
Accepted
# ABC 071: B – Not Found a = 'abcdefghijklmnopqrstuvwxyz' s = input() for c in s: if c in a: a = a.replace(c, '') print(a[0] if len(a) > 0 else 'None')
p02577
s908356045
Wrong Answer
user_input=input("N: ") i=len(user_input)-1 j=int(user_input) if j>=10**(200000): print("its out of the limit") else: number=0 while i>=0: number+=int(user_input[i]) i=i-1 if number%9==0: print("Yes") else : print("No")
p03994
s086820845
Accepted
alphabet = 'abcdefghijklmnopqrstuvwxyz' s = input() K = int(input()) ans = '' for i in range(len(s) - 1): s_i = alphabet.index(s[i]) if s[i] == 'a': ans += 'a' continue if (26 - s_i <= K): K -= 26 - s_i ans += 'a' else: ans += s[i] ans += alphabet[(K + alphabet.index(s[-1])) % 26] print(ans)
p03624
s521159665
Wrong Answer
s = list(input()) abc = list('abcdefghijklmnopqrstuvwxyz') abc_exist = [False] * 26 for i in range(len(s)): for j in range(26): if s[i] == abc[j]: abc_exist[j] = True for k in range(26): if abc_exist[k] == False: r = abc[k] else: r = 'None' print(r)
p02724
s816697074
Wrong Answer
x = int(input()) m500 = x // 500 m5 = (x - (x // 500) * 500) % 5 ans = m500 * 1000 + m5 * 5 print(ans)
p02578
s870972199
Accepted
N = int(input()) *A, = map(int, input().split()) ans = 0 for i in range(N-1): v1, v2 = A[i], A[i+1] if v1<=v2: continue ans += v1-v2 A[i+1] = v1 print(ans)