problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p02755 | s170620484 | Accepted | import sys
def input(): return sys.stdin.readline().strip()
def resolve():
def main():
a,b=map(int, input().split())
for i in range(13,1250):
if (i*8)//100==a and (i*10)//100==b:
return i
return -1
print(main())
resolve() |
p03696 | s168012943 | Accepted | N=int(input())
S=input()
cs=0
mincs=1000
enc={'(':1,')':-1}
for c in S:
cs+=enc[c]
mincs=min(mincs,cs)
while mincs<0:
S='('+S
mincs+=1
cs+=1
while cs>0:
S=S+')'
cs-=1
print(S)
|
p03103 | s941881495 | Wrong Answer | n,m = map(int,input().split())
li = []
for i in range(n):
a,b = map(int,input().split())
li.append([str(a),b])
li = sorted(li)
coin = 0
cnt = 0
i = 0
while cnt != m:
if li[i][1] <= 0:
i+=1
else:
li[i][1]-=1
coin += int(li[i][0])
cnt +=1
print(coin)
|
p02618 | s180424346 | Accepted | from random import randint
D = int(input())
c = list(map(int, input().split()))
s = []
for i in range(D):
s.append(list(map(int, input().split())))
### input end ###
for i in range(D):
print(randint(1, 26)) |
p02911 | s728562234 | Accepted | N,K,Q =map(int,input().split())
A = [int(input()) for i in range(Q)]
point = [K-Q]*N
for i in range(Q):
point[A[i]-1] +=1
for i in range(N):
if(point[i]>0):
print("Yes")
else:
print("No") |
p02600 | s336835399 | Wrong Answer | X = int(input())
if X >= 400 and X < 599:
print('8')
elif X >= 600 and X < 799:
print('7')
elif X >= 800 and X < 999:
print('6')
elif X >= 1000 and X < 1199:
print('5')
elif X >= 1200 and X < 1399:
print('4')
elif X >= 1400 and X < 1599:
print('3')
elif X >= 1600 and X < 1799:
print('2')
el... |
p03773 | s126268631 | Accepted | a,b = map(int,input().split())
print((a+b) % 24) |
p02996 | s614189782 | Accepted | n = int(input())
works = list()
for num in range(n):
a = list(map(int, input().split()))
works.append(a)
works.sort(key = lambda x :x[1])
time = 0
limit = 0
for row in works:
time += row[0]
limit = row[1]
if time > limit:
print("No")
exit()
print("Yes") |
p02842 | s858511568 | Accepted | n = int(input())
a = int(n/1.08)
if int(a*1.08) == n:
print(a)
elif int((a+1)*1.08) == n:
print(a+1)
else:
print(':(') |
p03821 | s097739677 | Accepted | n = int(input())
a = []
b = []
for i in range(n):
t, m = map(int, input().split())
a.append(t)
b.append(m)
ans = 0
for i in range(n):
if((ans + a[-1 - i]) % b[-1 - i]!=0):
ans += b[-1 - i] - (ans + a[-1 - i]) % b[-1 - i]
print(ans)
|
p02861 | s063933245 | Accepted | import itertools
N = int(input())
zahyo =[list(map(int,input().split())) for _ in range(N)]
N_list = [i for i in range(N)]
P = itertools.permutations(N_list,N)
P = list(P)
sm = 0
for p in P:
for i,j in zip(p,p[1:]):
xi,yi = zahyo[i]
xj,yj = zahyo[j]
sm += (((xi-xj)**2+(yi-yj)**2)**0.5)
print... |
p03471 | s173043363 | Accepted | N,Y=map(int,input().split())
A=[]
for i in range(Y//10000+1):
for j in range((Y-i*10000)//5000+1):
c1=(Y-10000*i-5000*j)/1000
c2=N-i-j
if c1==c2:
A=[i,j,c1]
break
if c1!=c2:
continue
if len(A)==0:
print("-1 -1 -1")
else:
A[2]=int(A[2])
... |
p02820 | s083384315 | Accepted | n,k=map(int,input().split())
r,s,p=map(int,input().split())
t=list(input())
rsp={"r":p,"s":r,"p":s}
sumt=0
chk=[1]*n
for i in range(len(t)):
sumt+=rsp[t[i]]
if i>=k and t[i]==t[i-k]:
chk[i]=chk[i-k]+1
chk[i-k]=1
ans=sumt
for i in range(len(chk)):
if chk[i]!=1:
chg=chk[i]//2
ans-=(rsp[t[i]])*chg
pr... |
p03331 | s214506813 | Accepted | # %% AGC 025 A
def sumOfDigits(n):
res = 0
while n > 0:
res += n % 10
n //= 10
return res
n = int(input())
mn = n
for i in range(1, n):
b = n - i
mn = min(sumOfDigits(i) + sumOfDigits(b), mn)
print(mn) |
p03625 | s513438418 | Accepted | n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
num1=0
num2=0
ans=1
for i in range(n):
if a[i]==num1:
ans*=a[i]
num2+=1
num1=0
else:
num1=a[i]
if num2==2:
break
if num2==2:
print(ans)
else:
print(0)
|
p02842 | s105325088 | Accepted | import math
f = True
N = int(input())
for i in range(N+1):
if math.floor(i*1.08) == N:
print(i)
f = False
break
if f:
print(":(")
|
p03107 | s370763806 | Accepted | s = input()
Answer = min(s.count('0'),s.count('1'))*2
print(Answer) |
p03556 | s092832412 | Wrong Answer | import numpy as np
n = int(input())
for i in range(n, 1, -1):
if np.sqrt(i) % 1 == 0:
print(i)
break |
p03338 | s892542775 | Accepted | _ = input()
S = input()
print(max(len(set(S[:i]) & set(S[i:])) for i in range(len(S)))) |
p03821 | s673016986 | Accepted | N = int(input())
A = [list(map(int,input().split())) for _ in range(N)]
cnt = 0
for i in range(N-1,-1,-1):
a = (-A[i][0]-cnt)%A[i][1]
cnt += a
print(cnt) |
p03041 | s760251638 | Accepted | n,k = map(int,input().split())
s = list(input())
t = ''
for j,i in enumerate(s):
if j == k-1:t += i.lower()
else:t+=i
print(t)
|
p03617 | s222432284 | Accepted | import sys
from decimal import Decimal
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
Q, H, S, D = MAP()
N = INT()
l = [(Decimal(0.25), Q, 0.25/Q), (Decimal(0.5), H, 0.5/H), (1, S, 1/S), (2, D, 2/D)]
l.sort(key=lambda x:x[2], reverse=True)
a... |
p03324 | s570467436 | Accepted | d,n=map(int, input().split())
if n != 100:
print(n*100**d)
else:
print(101*100**d) |
p03633 | s933244822 | Wrong Answer | def gcd(x, y):
if y == 0:
return x
else:
return gcd(y, x % y)
def lcm(a,b):
return a*b//gcd(a,b)
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
answer = 0
for index, tt in enumerate(sorted(t)):
if index + 1 == len(t):
continue
lc = lcm(tt, t[index+1])
if lc > answ... |
p02677 | s380798693 | Wrong Answer | import math
a,b,h,m = map(int,input().split())
deg = h*30+m*0.5-m*60
if deg <0:
deg = -deg
elif deg>180:
deg = 360-deg
bb = b*math.sin(math.radians(deg))
aa = a-b*math.cos(math.radians(deg))
print(math.sqrt((aa**2)+(bb**2)))
|
p02765 | s302119659 | Accepted | n, r = map(int, input().split())
if n <= 10:
print(r + 100 * (10 - n))
else:
print(r)
|
p03241 | s983798637 | Accepted | import math
N, M = map(int, input().split())
if N == 1:
print(M)
exit()
ans = 1
for a in range(1, int(math.sqrt(M))+1):
b = M // a
if M % a != 0:
continue
if a * N <= M:
ans = max(ans, a)
if b * N <= M:
ans = max(ans, b)
print(ans)
|
p02823 | s318197749 | Accepted | n, a, b = map(int, input().split())
if a % 2 == b % 2:
print(abs(a-b)//2)
else:
print(min(a-1, n-b)+1+((b-a)//2))
# print(min(a-1, n-b))
# print(1)
# print(((b-a)//2))
|
p03759 | s180803136 | Accepted | a,b,c = [int(i) for i in input().split()]
if (b-a) == (c-b):
print("YES")
else:
print("NO") |
p03219 | s446532471 | Accepted | x, y = map(int, input().split())
print(int(x + y / 2)) |
p02948 | s259159926 | Wrong Answer | import heapq
n , m = map(int, input().split())
ab=[[] for i in range(10**5)]
for i in range(n):
a , b = map(int, input().split())
ab[a-1].append(b*(-1))
que=[]
c=0
while que==[] and c<m:
if ab[c]!=[]:
que=ab[c]
c+=1
heapq.heapify(que)
ans = 0
for i in range(m):
if i>=c:
que=list(h... |
p03455 | s110742187 | Accepted | a, b = map(int, input().split())
amari = a * b % 2
if amari == 0:
print('Even')
else:
print('Odd') |
p03607 | s722783124 | Accepted | N = int(input())
paper = set()
A = 0
for _ in range(N):
A = int(input())
if A in paper:
paper.discard(A)
else:
paper.add(A)
print(len(paper)) |
p02766 | s304320340 | Wrong Answer | import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop
def main():
n, k = map(int, input().split())
a = 0
while n > 0:
a += 1
n /= k
... |
p03862 | s500800590 | Wrong Answer | n, x = map(int, input().split())
a = list(map(int, input().split()))
r = 0
for i in range(1, n):
if a[i] + a[i-1] > x:
r += abs(a[i]+a[i-1] - x)
a[i] = a[i] - r
if a[i] < 0:
a[i-1] += a[i]
a[i] = 0
print(r) |
p02658 | s041374010 | Accepted |
a = input()
l = list(map(int,input().split()))
ans = 1
if 0 in l:
print(0)
exit()
for i in l:
ans *= i
if ans>10**18:
print(-1)
exit()
if ans > 10**18:
ans=-1
print(ans) |
p03474 | s214909721 | Accepted | #
import sys
input=sys.stdin.readline
def main():
num="0123456789"
A,B=map(int,input().split())
S=input()
sn=S[:A]+S[A+1:A+B+1]
y=1
for i in sn:
if not i in num:
y=0
break
if S[A]!="-":
y=0
if y==1:
print("Yes")
else:
print("N... |
p03639 | s169882260 | Accepted | n = int(input())
A = list(map(int, input().split()))
cnt4 = 0
cnt2 = 0
other = 0
for a in A:
if a % 4 == 0:
cnt4 += 1
continue
if a % 2 == 0:
cnt2 += 1
else:
other += 1
if cnt4+1 >= cnt2 + other or cnt4 >= other:
print('Yes')
else:
print('No')
|
p03612 | s873709275 | Accepted | n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(n-1):
if p[i] - 1 == i:
count += 1
p[i] ,p[i + 1] = p[i + 1], p[i]
if p[n - 1] - 1 == n - 1:
count += 1
print(count) |
p02767 | s999348452 | Wrong Answer | N = int(input())
X_s = tuple(map(int,input().split()))
MIN = 10**5
for i in range(1,101):
SUM = sum(tuple(map(lambda x:(x-i)**2, X_s)))
if MIN > SUM:
MIN = SUM
print(MIN)
|
p02631 | s131160557 | Accepted | n = int(input())
a = list(map(int, input().split()))
x = 0
for a_i in a:
x ^= a_i
for a_i in a:
print(x ^ a_i) |
p02640 | s648756045 | Wrong Answer | A,B=map(int,input().split())
if A-2*B >=1 and (A-2*B)%2==0:
print("Yes")
else:
print("No") |
p02795 | s875820808 | Accepted | h = int(input())
w = int(input())
n = int(input())
for i in range(1, 100000):
if h * i >= n or w * i >= n:
print(i)
exit()
|
p02717 | s034451550 | Accepted | a = list(map(int,input().split()))
print(a[2],a[0],a[1],sep=" ") |
p02912 | s451146393 | Wrong Answer | from heapq import heappush, heappop, heapify
import numpy as np
N, M = map(int,input().split())
A = list(map(int,input().split()))
A = np.array(A)
A = -A
A = list(A)
for _ in range(M):
heapify(A)
s = heappop(A)
heappush(A, -(-s // 2))
print(s)
A = np.array(A)
print(-int(np.sum(A))) |
p02663 | s354704784 | Accepted | h1, m1, h2, m2, k = map(int, input().split())
if m1 > m2:
print(((h2 - 1) - h1) * 60 + (m2 + 60 - m1) - k)
else:
print((h2 - h1) * 60 + (m2 - m1) - k) |
p02576 | s192055364 | Accepted | N,X,T = map(int, input().split())
if N%X == 0:
print(N//X*T)
else:
print((N//X+1)*T) |
p02663 | s495910054 | Wrong Answer | #a = input()
a, b, c, d, e = map(int, input().split())
# get a string
#s = raw_input()
# output
start = a*60+b
end = c*60+d
result = end - start
print(result) |
p02982 | s887716256 | Accepted | from math import sqrt
N, D = map(int, input().split())
X = []
for _ in range(N):
x = list(map(int, input().split()))
X.append(x)
ans = 0
for i in range(0, N):
for j in range(i + 1, N):
res = 0
for x1, x2 in zip(X[i], X[j]):
res += (x1 - x2) ** 2
res = sqrt(res)
... |
p03679 | s144349512 | Accepted | X, A, B = map(int, input().split())
if B - A <= 0:
print('delicious')
elif X >= B - A > 0:
print('safe')
else:
print('dangerous') |
p03352 | s217334173 | Accepted | x=int(input())
ans=1
for i in range(1,1000+1):
for j in range(2,11):
if i**j<=x:
ans=max(ans,i**j)
print(ans) |
p02918 | s880452996 | Accepted | def solve(a,k):
curr_char = a[0]
curr_len = 0
segs = 1
for x in a:
if x==curr_char:
curr_len += 1
else:
segs += 1
curr_len = 1
curr_char = x
return len(a)-max(1,segs-2*k)
n,k = map(int,input().split())
print(solve([1 if c=='L' else 0 fo... |
p02773 | s762105055 | Wrong Answer | # coding: utf-8
if __name__ == '__main__':
dic = dict()
n = int(input())
for i in range(n):
val = input()
if val in dic.keys():
dic[val]+=1
else:
dic[val]=1
max_keys = max(dic.values())
values_of_max_key = [val for val in dic if dic[val] == max_keys]
... |
p03645 | s112862665 | Wrong Answer | n, m = map(int, input().split())
ab = [[] for _ in range(n)]
for _ in range(m):
a, b = map(int, input().split())
ab[a-1].append(b)
ab[b-1].append(a)
for i in ab[0]:
if n in ab[i-1]:
print('POSSIBLE')
exit()
print('INPOSSIBLE') |
p03387 | s489630284 | Wrong Answer | a,b,c=map(int,input().split())
s=max(a,b,c)
m=3*s-(a+b+c)
if m%2:print(m//2+1)
else:print(m//2) |
p03457 | s341154756 | Accepted | n = int(input())
t=0
x=0
y=0
ans ="Yes"
for i in range(n):
tt,xx,yy = map(int,input().split())
dif = abs(x-xx)
dif +=abs(y-yy)
if dif>(tt-t) or dif%2 !=(tt-t)%2:
ans = "No"
break;
t=tt
x=xx
y=yy
print(ans) |
p03835 | s690028742 | Accepted | #!/usr/bin/env python
def main():
k, s = list(map(int, input().split()))
ans = 0
for x in range(k+1):
for y in range(k+1):
z = s - x - y
if z >= 0 and z <= k:
ans += 1
print(ans)
if __name__ == '__main__':
main()
|
p03672 | s278689312 | Wrong Answer | import sys
input = sys.stdin.readline
s=input().strip()
flg=True
s=s[:-2]
while len(s)>=2:
for i in range(len(s)//2):
if s[i]!=s[len(s)//2+i]:
flg=False
if flg:
print(s)
exit()
s=s[:-2]
flg=True
|
p02982 | s934001625 | Wrong Answer | #133 b
import itertools
n,d=map(int,input().split())
N=[i for i in range(n)]
k=[i*i for i in range(2,100)]
x=[]
for i in range(n):
a=list(map(int,input().split()))
x.append(a)
ans=0
kumi=itertools.combinations(N,2)
for a,b in kumi:
s=0
for j in range(d):
s+=(x[a][j]-x[b][j])**2
if s in k:
... |
p02970 | s696986716 | Wrong Answer | N,D = map(int, input().split())
count = 0
i = 0
while i < N:
i += 2*D+1
count +=1
print(count+1)
|
p03862 | s820241927 | Accepted | N, x = map(int,input().split())
a = list(map(int,input().split()))
res = 0
if a[0]>x:
res += a[0]-x
a[0] = x
if a[-1]>x:
res += a[-1]-x
a[-1] = x
for i in range(1,N):
tmp = a[i]+a[i-1]
if tmp>x:
res += tmp-x
a[i] -= tmp-x
print(res)
|
p02909 | s855636508 | Accepted | x = input()
st = [ 'Sunny' , 'Cloudy' , 'Rainy' ]
print(st[(st.index(x) + 1) % 3]) |
p02993 | s774080140 | Accepted | S = input()
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]: print('Bad')
else: print('Good') |
p03239 | s320131746 | Accepted | n, t = map(int, input().split())
ans = 2000
for i in range(n):
ci, ti = map(int, input().split())
if ti <= t:
ans = min(ans, ci)
if ans == 2000:
print("TLE")
else:
print(ans) |
p02768 | s403816789 | Accepted | from operator import mul
from functools import reduce
mod = 10**9+7
def nCr(n, r, mod):
r = min(r, n-r)
numer = denom = 1
for i in range(1, r+1):
numer = numer * (n+1-i) % mod
denom = denom * i % mod
return numer * pow(denom, mod-2, mod) % mod
n, a, b = map(int, input().split(... |
p03612 | s808949147 | Wrong Answer | n = int(input())
p = list(map(int,input().split()))
ans = 0
for i in range(n-1):
if p[i] == i+1 or p[i+1] == i+2:
p[i],p[i+1] = p[i+1],p[i]
ans += 1
if p[n-1] == n:
p[n-1],p[n-2] = p[n-2],p[n-1]
print(ans) |
p02714 | s366127857 | Accepted | n = int(input())
s = list(input())
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r * g * b
for i in range(n-2):
for j in range(i+1,n-1):
if (j - i) + j < n:
k = (j - i) + j
if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
ans -= 1
print(ans) ... |
p02983 | s314579070 | Wrong Answer | # https://atcoder.jp/contests/abc133/tasks/abc133_c
l, r = map(int, input().split())
dp = [0] * 2019
for i in range(2019 * 3):
n = l + i
if n <= r:
m = n % 2019
dp[m] += 1
else:
break
ans = 1
c = 0
i = 0
while i < len(dp):
if dp[i]:
ans *= i
dp[i] -= 1
... |
p02693 | s766352938 | Accepted | k = int(input())
a, b = map(int, input().split())
if a % k == 0 or b % k == 0:
print("OK")
else:
if b // k - a // k > 0:
print("OK")
else:
print("NG") |
p03434 | s874372809 | Accepted | #6
N = int(input())
a = sorted(list(map(int, input().split())))
Alice_list = []
Bob_list = []
for i in range(1, N+1):
if i%2==1:
Alice_list.append(a[-i])
else:
Bob_list.append(a[-i])
print(sum(Alice_list)-sum(Bob_list)) |
p03106 | s089803959 | Wrong Answer | a,b,k = map(int,input().split(" "))
count = 0
for i in range(101,1,-1):
if a%i == 0 and b%i ==0:
count += 1
if count == k:
print(i)
break
|
p03380 | s736756573 | Wrong Answer | import math
f = math.factorial
_, *a = map(int, open(0).read().split())
a.sort()
n = a.pop(-1)
r = sorted((abs(n/2 - i), i) for i in a)[0][1]
print(f(n) // (f(n-r) * f(r))) |
p03778 | s849153498 | Accepted | w,a,b = list(map(int,input().split()))
ans = b-(a+w) if a <= b else a-(b+w)
print(ans if ans >= 0 else 0)
|
p03319 | s553369367 | Accepted | import math
n, k = map(int, input().split())
A = list(map(int, input().split()))
mi = min(A)
cnt = A.count(mi)
print(math.ceil((n-cnt)/(k-1)))
|
p02700 | s368936702 | Accepted | a,b,c,d = map(int,input().split())
while(1):
c -= b
if(c <= 0):
print('Yes')
exit()
a -= d
if(a <= 0):
print('No')
exit() |
p03013 | s763248777 | Wrong Answer | n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[1]+['']*n
for i in a:
dp[i]=0
if dp[1]=='':
dp[1]=1
for i in range(2,n+1):
if dp[i]=='':
dp[i]=dp[i-1]+dp[i-2]
print(dp[-1])
|
p03210 | s017857307 | Accepted | n=str(input())
print("YES" if n in "753" else "NO") |
p02970 | s265104072 | Wrong Answer | n,d = list(map(int,input().split()))
print(n//(d+d+1)) |
p02706 | s421488658 | Accepted | n, m = map(int, input().split())
homework_cost = list(map(int, input().split()))
sum = 0
for i in range(len(homework_cost)):
sum += homework_cost[i]
if n - sum >= 0:
print(n - sum )
else:
print(-1) |
p02917 | s510472597 | Accepted | n = int(input())
b = list(map(int, input().split()))
ans = b[0] + b[n-2]
for i in range(n-2):
ans += min(b[i], b[i+1])
print(ans) |
p02584 | s192745159 | Wrong Answer | from sys import stdin
input = stdin.readline
X, K, D = map(int, input().split())
m = X % D
l = X // D
if D - m < m:
m = D - m
l += 1
if l > K:
print(abs(X) - D * K)
else:
if (K - l) % 2 == 0:
print(m)
else:
print(D - m)
|
p03836 | s027318973 | Accepted | sx,sy,tx,ty = map(int,input().split())
U,D,L,R = 'U','D','L','R'
dx,dy = tx-sx,ty-sy
ans = R*dx+U*dy + L*dx+D*(dy+1) + R*(dx+1)+U*(dy+1)+L +U+L*(dx+1)+D*(dy+1)+R
print(ans) |
p02983 | s432447068 | Accepted | l,r = map(int,input().split())
cnt = 0
mod_list = []
if r- l >=2019:
print(0)
else:
for i in range(l,r):
for j in range(i+1,r+1):
mod_list.append(i*j%2019)
print(min(mod_list)) |
p03437 | s516809796 | Wrong Answer | x,y=map(int,input().split())
print(x if x!=y else 0) |
p03211 | s923165150 | Accepted | import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
def main():
s = IS()
minv = 10**5
for i in range(len(s)-2):
d = int(s[i:i+3])
minv = min(minv, abs(753-d))
print(minv)
if __name__ == '__main__':
main()
|
p02712 | s692557847 | Accepted | n = int(input())
sum = 0
for i in range(1,n+1,1):
if(i%3 == 0 or i%5 == 0):
continue
sum += i
print(sum)
|
p02553 | s641257795 | Accepted | a,b,c,d = map(int,input().split())
A = set()
B = set()
A.add(a)
A.add(b)
B.add(c)
B.add(d)
for i in {-1,0,1}:
A.add(i)
B.add(i)
o = set()
for j in A:
for k in B:
if a <= j <= b and c <= k <= d:
o.add(j*k)
print(max(o)) |
p03720 | s654253395 | Accepted | N, M = map(int,input().split())
ans = [0 for i in range(N)]
for i in range(M):
ab = list(map(int,input().split()))
ans[ab[0]-1] += 1
ans[ab[1]-1] += 1
for i in range(N):
print(ans[i]) |
p02743 | s910878736 | Wrong Answer | import numpy as np
from decimal import *
getcontext().prec = 6
a,b,c = map(int,input().split())
if Decimal(a**0.5)+Decimal(b**0.5) < Decimal(c**0.5):
print("Yes")
else:
print("No") |
p03472 | s714455066 | Accepted | #https://atcoder.jp/contests/abc085/tasks/abc085_d
import math
N, H = map(int, input().split(' '))
A = []
B = []
for _ in range(N):
a, b = map(int, input().split(' '))
A.append(a)
B.append(b)
max_A = max(A)
B = sorted(B, reverse=True)
ans = H
for k in range(N):
H -= B[k]
if H > 0:
cnt = math... |
p03137 | s900355380 | Accepted | N,M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()
ruisekisa = [0]*(M-1)
for i in range(0,M-1,1):
ruisekisa[i]=X[i+1]-X[i]
ruisekisa.sort()
print(sum(ruisekisa[0:max(M-N,0)]))#負方向のout index が変な挙動するのよ
|
p02641 | s216668802 | Accepted | X,N = map(int,input().split())
if N == 0:
print(X)
elif N == 100:
if X > 50:
print(101)
else:
print(0)
else:
List = list(map(int,input().split()))
List.sort()
c = 10 ** 10
ans = 1000
for i in range(-100,200):
if not i in List:
if abs(i - X) < c:
c = abs(i-X)
ans = ... |
p03836 | s781811520 | Accepted | sx,sy,tx,ty = map(int,input().split())
S = ""
for k in range(2):
if k == 1:
S += "L"
for i in range(ty-sy+k):
S += "U"
for i in range(tx-sx+k):
S += "R"
if k == 1:
S += "DR"
for i in range(ty-sy+k):
S += "D"
for i in range(tx-sx+k):
S += "L"
i... |
p02924 | s289294874 | Wrong Answer | n = int(input())
print(int(n * (n - 1) / 2)) |
p03565 | s885412292 | Wrong Answer | import re
s = input().replace('?', '.')
t = input()
for i in range(len(s)-len(t)+1):
if re.match(s[i:i+len(t)], t):
print(s[:i].replace('.','a')+t+s[i+len(t):].replace('.','a'))
break
else:
print('UNRESTORABLE')
|
p03711 | s346326274 | Accepted | a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]
x,y = map(int,input().split())
if (x in a and y in a) or (x in b and y in b):
print("Yes")
else:
print("No")
|
p02771 | s873745053 | Wrong Answer | A,B,C=map(int, input().split()) #1 2 3
if (A == B and A != C) or (A != B and A == C):
print("YES")
else:
print("NO")
|
p03386 | s761716395 | Accepted | a,b,k=map(int,input().split())
if b-a>=k*2-1:
for i in range(k):
print(a+i)
for i in range(k):
print(b+1-(k-i))
else:
for j in range(a,b+1):
print(j) |
p03644 | s842506047 | Accepted | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
def main():
N = int(input())
print(2**int(math.log2(N)))
if __name__ == "__main__":
main()
|
p03252 | s643181153 | Wrong Answer | import sys
sys.setrecursionlimit(10 ** 6)
def main():
S = input()
T = input()
same = set()
for i in range(len(S)):
if S[i] == T[i]:
same.add(S[i])
for i in range(len(S)):
if S[i] != T[i]:
if S[i] in same or T[i] in same:
print('No')
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.