problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p02777 | s361685317 | Accepted | s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if u == s:
print(a-1, b)
else:
print(a, b-1) |
p02665 | s411252775 | Wrong Answer | N = int(input())
A = list(map(int, input().split()))
last = A[-1]
count = last
root = 1
for i in range(N):
if root <= A[i]:
print(-1)
break
if i+1 == N and root-A[i] > A[i+1]:
root = last + A[i]
elif root-A[i] > (last + A[i+1]):
root = (last + A[i+1]) + A[i]
count+=root
root = (root-A[i])*2
else:
if count == 0 or root < last:
count = -1
print(count) |
p02797 | s091936869 | Accepted | n,k,s = map(int, input().split())
if s!=10**9:
x = [10**9]*n
else:
x = [1]*n
for i in range(k):
x[i]=s
print(*x)
|
p02664 | s042432152 | Wrong Answer | s = input()
t = ''
if s[0] == '?':
t = 'P'
else:
t = s[0]
for i in range(1, len(s)):
if s[i] == '?':
if t[-1] == 'P':
t += 'D'
else:
t += 'P'
else:
t += s[i]
print(t)
|
p02801 | s736033699 | Accepted | C = str(input())
print(chr(ord(C)+1)) |
p03077 | s906265441 | Accepted |
trans = []
n = int(input())
for i in range(5):
trans.append(int(input()))
m=min(trans)
if n%m==0:
print(n//m+4)
else:
print(n//m+5) |
p03557 | s464012202 | 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()
B.sort()
C.sort()
count = 0
for j in range(n):
i = bisect.bisect_left(A, B[j])
k = bisect.bisect(C, B[j])
count += (i * (n - k))
print(count) |
p02613 | s613573618 | Accepted | n = int(input())
L = list(str(input()) for _ in range(n))
print('AC x', L.count('AC'))
print('WA x', L.count('WA'))
print('TLE x', L.count('TLE'))
print('RE x', L.count('RE'))
|
p02916 | s443170419 | Accepted | n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
manzoku = 0
for i in range(n):
manzoku += b[a[i]-1]
if i != 0:
if (a[i]==a[i-1]+1):
manzoku += c[a[i-1]-1]
print(manzoku) |
p02603 | s924402230 | Accepted | #dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]
n = inp()
x = ip()
i = 0
ct = 1000
while i < n-1:
while i < (n - 1) and x[i + 1] <= x[i]:
i += 1
if i == n - 1:
break
buy = i
i += 1
while i < n and x[i] >= x[i - 1]:
i += 1
sell = i - 1
no = ct//x[buy]
profit = no*(x[sell]-x[buy])
ct += profit
print(ct)
|
p02663 | s342426795 | Wrong Answer | H1, M1, H2, M2, K = input().split()
H1, M1, H2, M2, K = int(H1), int(M1), int(H2), int(M2), int(K)
allm1 = H1*60+M1
allm2 = H2*60+M2
m = allm2 - allm1
if m == K:
print('0')
exit()
i = 0
while True:
m = m - K
if m <= 0:
break
else:
i = i + 1
print(i*K) |
p03206 | s412233357 | Accepted | import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7
s = ri()
print(['Christmas Eve Eve Eve', 'Christmas Eve Eve', 'Christmas Eve', 'Christmas'][s-22])
|
p03486 | s632106440 | Wrong Answer | s = sorted(input(), reverse = True)
t = sorted(input(), reverse = True)
larger = len(s) if len(s) > len(t) else len(t)
try:
for i in range(larger):
if s[i] > t[i]:
print('No')
break
elif s[i] < t[i]:
print('Yes')
break
else:
print('No')
except:
if len(s) < len(t):
print('Yes')
else:
print('No') |
p03324 | s425675403 | Accepted | D, N = map(int, input().split())
if N == 100:
print(101 * 100 ** D)
else:
print(N * 100 ** D) |
p02753 | s557250822 | Accepted | S = list(input())
if (len(set(S)) == 1):
ans = 'No'
else:
ans = 'Yes'
print(ans) |
p02555 | s937239857 | Wrong Answer | num=int(input())
count=0
if(num<3):
count=0
elif(num>=6):
for i in range(3,num//2):
count+=1
if(num%2==0):
count=count*2+2
else:
count=count*2+1+2
elif(num>2 and num<6):
count=1
print(count%(10**9+7)) |
p02688 | s572821546 | Accepted | n, k = map(int,input().split())
n_k = [0 for i in range(n)]
for i in range(k):
_n = int(input())
_k = list(map(int, input().split()))
for i in _k:
n_k[i-1] += 1
print(len([1 for i in n_k if i==0])) |
p02612 | s108541935 | Accepted | n = int(input())
print(-n % 1000) |
p03386 | s702996377 | Accepted | a, b, k = [int(x) for x in input().split()]
r = range(a, b + 1)
for i in sorted(set(r[:k]) | set(r[-k:])):
print(i)
|
p03136 | s783940575 | Accepted | n = int(input())
a = [int(e) for e in input().split()]
ans ='No' if max(a)>= sum([e for e in a])-max(a) else 'Yes'
print(ans) |
p03910 | s122450242 | Accepted | def main():
n = int(input())
max, dif = 0, 0
for i in range(1, 10000):
s = i * (i + 1) // 2
if s >= n:
max = i
dif = s - n
break
[print(i) for i in range(1, max + 1) if i != dif]
if __name__ == '__main__':
main()
|
p02624 | s027807733 | Accepted | #別解思考
n = int(input())
res = 0
for i in range(1, n // 2 +1):
res += (int(n / i) * (i + int(n / i) * i)) // 2
res += (n + n // 2 +1) * (n - n // 2 ) //2
print(res) |
p04043 | s470027947 | Accepted | a, b, c = map(int, input().split())
iroha = [a, b, c]
if iroha.count(5) == 2 and iroha.count(7) == 1:
print("YES")
else:
print("NO") |
p03103 | s443060893 | Accepted | N, M = [int(i) for i in input().split()]
AB = []
for _ in range(N):
AB.append([int(i) for i in input().split()])
AB = sorted(AB)
money = 0
for i in AB:
a = M - i[1]
if a > 0:
M = a
money += i[1]*i[0]
else:
money += M*i[0]
break
print(money) |
p04033 | s312107697 | Wrong Answer | a,b=map(int,input().split())
if a<0 and b<0:
aa=a%2
bb=b%2
if (aa+bb)%2==1:
print("Positive")
else:
print("Negative")
exit()
if a<=0 or 0<=b:
print("Zero")
exit()
if 0<a and 0<b:
print("Positive")
exit()
|
p03067 | s318262148 | Accepted | a,b,c=map(int,input().split())
print("Yes" if a<=c<=b or b<=c<=a else "No" )
|
p03860 | s188013929 | Accepted | if __name__ == "__main__":
str = input()
a,b,c = str.split()
print(a[0]+b[0]+c[0]) |
p03448 | s392498372 | Wrong Answer | a=int(input())
b=int(input())
c=int(input())
x=int(input())
cnt=0
for i in range(a+1):
for j in range(b+1):
for k in range(c+1):
if a*500+b*100+c*50==x:
cnt+=1
print(cnt) |
p02730 | s254650333 | Accepted | frag=0
a = list(input())
N=len(a)-1
for i in range(int(N/2)):
if a[i]!=a[N-i]:
frag=1
break
if frag==0:
for i in range(int(N/4)):
if a[i]!=a[int(N/2-i-1)] or a[N-i]!=a[int(N/2+i+1)]:
frag=1
break
if frag==0:
print('Yes')
else:
print('No') |
p03086 | s937463686 | Wrong Answer | s = input()
valid_chars = ["A", "C", "G", "T"]
tmp_ans = 0
ans = 0
for c in s:
if c in valid_chars:
tmp_ans += 1
else:
ans = max(tmp_ans, ans)
tmp_ans = 0
print(ans)
|
p03852 | s796307455 | Accepted | c = input()
print('vowel' if 'a' in c or 'i' in c or 'u' in c or 'e' in c or 'o' in c else 'consonant') |
p03211 | s773338369 | Wrong Answer | S=str(input())
min_dif = 1000
for i in range(len(S)-2):
dif = int(S[i:i+3])
if min_dif > dif:
min_dif = dif
print(dif) |
p03339 | s156054993 | Accepted | N=int(input())
S=input()
a=S.count("E")
c=a
for s in S:
if s=="E":
c-=1
else:
c+=1
a=min(a,c)
print(a)
|
p03761 | s255945662 | Wrong Answer | n = int(input())
S = list(input() for _ in range(n))
if n == 1:
print()
else:
def intersect_list(l1, l2):
arr = []
lst = l1.copy()
for element in l2:
try:
lst.remove(element)
except ValueError:
pass
else:
arr.append(element)
return arr
l = intersect_list(list(S[0]), list(S[1]))
for i in range(2, n):
l = intersect_list(l, list(S[i]))
l.sort()
print("".join(l)) |
p03556 | s488740439 | Wrong Answer | n=int(input())
if n==0:
print(0)
exit()
for i in range(n):
if i**2 > n:
print((i-1)**2)
break |
p02796 | s277747682 | Accepted | n = int(input())
itv = []
for i in range(n):
x,l = map(int,input().split())
itv.append([x+l-0.1,x-l+0.1])
itv.sort()
ass = 0
tt = -float("inf")
for i in range(n):
if tt < itv[i][1]:
ass += 1
tt = itv[i][0]
print(ass) |
p03556 | s496206830 | Accepted | n = int(input())
i = 0
while i**2 <= n:
i += 1
print((i-1)**2)
|
p02664 | s835501784 | Accepted | import sys
sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline
def solve():
T = rl().rstrip()
ans = []
for ti in T:
if ti == '?':
ans.append('D')
else:
ans.append(ti)
print(''.join(ans))
if __name__ == '__main__':
solve()
|
p02631 | s271049319 | Accepted | N = int(input())
A = [int(i) for i in input().split()]
X = 0
for a in A:
X = X ^ a
for a in A:
print(X ^ a, end=" ")
|
p03206 | s203953266 | Accepted | import sys
INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
sys.setrecursionlimit(10 ** 9)
def main():
D = INT()
print("Christmas" + " Eve"*(25 - D))
if __name__ == '__main__':
main() |
p02554 | s017757822 | Wrong Answer | #!/usr/bin/env pypy3
MODULUS = 10**9+7
N = int(input())
ret = pow(10, N, MODULUS)
ret -= 2*pow(9, N, MODULUS)
ret += pow(8, N, MODULUS)
print(ret) |
p03815 | s976599497 | Accepted | import math
url = "https://atcoder.jp//contests/abc057/tasks/abc057_c"
def main():
x = int(input())
ans, div = divmod(x, 11)
ans *= 2
ans += math.ceil(div/6)
print(ans)
if __name__ == '__main__':
main()
|
p02600 | s687240153 | Accepted | X = int(input())
if X < 600:
print(8)
elif X<800:
print(7)
elif X<1000:
print(6)
elif X<1200:
print(5)
elif X<1400:
print(4)
elif X<1600:
print(3)
elif X<1800:
print(2)
else:
print(1) |
p02957 | s913492642 | Accepted | A,B = map(int,input().split())
if((A+B)%2==0):
print((A+B)//2)
else:
print("IMPOSSIBLE") |
p02705 | s525217133 | Accepted | import math
r = int(input())
print(r*2*math.pi) |
p02989 | s908573318 | Accepted | N = int(input())
d = list(map(int, input().split()))
d.sort()
s, t = N//2-1, N//2
ans = d[t] - d[s]
print(ans) |
p02708 | s766413706 | Accepted | n,k = [int(x) for x in input().split()]
a = [0] * (n + 1)
for i in range(1,n+1):
a[i] = a[i-1] + i
#print(a)
res = 0
for i in range(k,n+1):
ma = a[n] - a[n-i]
mi = a[i-1]
res += ma - mi + 1
#print(i,res,ma,mi)
res += 1
res %= 10 ** 9 + 7
print(res) |
p03485 | s177221449 | Accepted | import math
a, b = map(int, input().split())
x = math.ceil((a + b) / 2)
print(x) |
p02866 | s392336365 | Wrong Answer | from collections import Counter
mod = 998244353
n = int(input())
dl = list(map(int, input().split()))
c = Counter(dl)
if c[0]!=1:
print(0)
exit()
for x in range(max(dl)+1):
if c[x]==0:
print(0)
exit()
res = 1
for x in range(max(dl)):
res *= pow(c[x],c[x+1],mod)
res %= mod
print(res) |
p02612 | s775256261 | Accepted | n = int(input())
if n%1000 > 0:
print(1000-n%1000)
else:
print(0) |
p02838 | s368721504 | Accepted | n=int(input())
a=list(map(int,input().split()))
mod=10**9+7
c=[0]*60
for aa in a:
for i in range(60):
if aa&(1<<i):c[i]+=1
ans=0
for i,cc in enumerate(c):
ans+=cc*(n-cc)*2**i
ans%=mod
print(ans)
|
p03359 | s844230646 | Accepted | a, b = map(int, input().split())
ans = a
if a > b: ans -= 1
print(ans) |
p03359 | s695453333 | Accepted | from sys import stdin, stdout
def main():
line = stdin.readline()
parts = line.split()
mes = int(parts[0])
dia = int(parts[1])
stdout.write(str(mes if dia>=mes else mes-1))
main() |
p02917 | s271225497 | Wrong Answer | n=int(input())
b=list(map(int,input().split()))
a=[]
a.append(b[0])
for i in range(1,n-1):
if b[i]<b[i-1]:
a[i-1]=b[i]
a.append(b[i])
print(sum(a)) |
p03723 | s306575649 | Accepted | a, b, c = map(int, input().split())
if a == b and a == c:
if a % 2 == 1:
print(0)
exit()
else:
print(-1)
exit()
ans = 0
s, t, u = 0, 0, 0
while a%2==0 and b%2==0 and c%2==0:
s = b//2 + c//2
t = a//2 + c//2
u = a//2 + b//2
a, b, c = s, t, u
ans += 1
print(ans) |
p03612 | s471993295 | Accepted | #解説見た
n = int(input())
p = list(map(int, input().split()))
p.append(0)
ans = 0
for i in range(n):
if p[i] == (i+1):
p[i],p[i+1] = p[i+1], p[i]
ans += 1
print(ans) |
p02819 | s762913698 | Accepted | from math import sqrt
def IsPrime(num):
if num < 2:
return True
elif num == 2:
return True
elif num % 2 == 0:
return False
sqrtNum = sqrt(num)
for i in range(3, int(sqrtNum) + 1, 2):
if num % i == 0:
return False
return True
if __name__ == "__main__":
x = int(input())
for i in range(x, 10**5+4):
if IsPrime(i):
print(i)
exit()
|
p02691 | s054760481 | Wrong Answer | import itertools
a=int(input())
ct=0
b=list(map(int,input().split()))
n=list(range(len(b)))
c=list(itertools.permutations(n,2))
for i in range(len(c)):
e=c[i][0]
f=c[i][1]
if b[e]+b[f]==abs(e-f):
ct+=1
print(ct/2) |
p02819 | s202286319 | Wrong Answer | x=int(input())
def prime(n):
for i in range(2, 100000):
if n % i == 0:
return False
else:
return True
while prime(x) == False:
x += 1
print(x) |
p02951 | s145436036 | Accepted | A, B, C = list(map(int, input().split()))
if C-(A-B)<=0:
print("0")
else:
print(C-(A-B)) |
p02813 | s801507043 | Accepted | import itertools
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
num_list = [i+1 for i in range(N)]
a = 1
for i in list(itertools.permutations(num_list)):
if P==i:
break
else:
a += 1
b = 1
for i in list(itertools.permutations(num_list)):
if Q==i:
break
else:
b += 1
if a-b>=0:
print(a-b)
else:
print(-a+b) |
p03472 | s371077462 | Wrong Answer | # coding: utf-8
from math import ceil
N, H = map(int, input().split())
li = []
atop = 0
for _ in range(N):
a, b = map(int, input().split())
atop = max(atop, a)
li.append([a, b])
li.sort(key=lambda x: x[1], reverse=True)
# print(li)
ans = ceil(H/atop)
cnt = 0
for i in range(N):
H -= li[i][1]
if H < 0:
break
cnt += 1
ans = min(ans, cnt + ceil(H/atop))
print(ans) |
p03059 | s608451985 | Accepted | a,b,t=map(int,input().split())
bis=0
time=0
while time+a<t+0.5:
bis+=b
time+=a
print(bis)
|
p02916 | s153919902 | Accepted | N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
before = 10**3
ans = 0
for i in A:
if i - before == 1:
ans += C[before-1]
before = i
ans += sum(B)
print(ans) |
p02793 | s439867091 | Accepted | N = int(input())
A = [int(v) for v in input().split()]
def gcd(v1, v2):
if v2 == 0:
return v1
return gcd(v2, v1 % v2)
A.sort()
a1 = A[0]
for a2 in A[1:]:
a3 = gcd(a1, a2)
a1 = a1 * a2 // a3
v = a1
total = 0
for a in A:
total += v // a
# while total > 1000000007:
# total -= 1000000007
total %= 1000000007
print(total) |
p02572 | s363919160 | Wrong Answer | N = int(input())
A = list(map(int, input().split()))
ans = 0
mod = 1e9 + 7
s = sum(A) % mod
for i in range(N):
s -= A[i]
ans += A[i] * s
ans = ans % mod
print(int(ans)) |
p03623 | s903129018 | Accepted | x,a,b = [int(x) for x in input().split()]
if abs(x-a) > abs(x-b):
print("B")
else:
print("A") |
p03625 | s064369106 | Accepted | import collections
n = int(input())
a = [int(i) for i in input().split()]
dic = collections.defaultdict(int)
for i in range(n):
dic[a[i]] += 1
ans = 0
ls = list(dic.keys())
ls.sort()
ans_ls = []
for i in range(len(ls)-1,-1,-1):
if dic[ls[i]] >= 2:
ans_ls.append(ls[i])
if dic[ls[i]] >= 4:
ans_ls.append(ls[i])
if len(ans_ls) < 2:
print(0)
else:
print(ans_ls[0] * ans_ls[1]) |
p02659 | s513580194 | Accepted | a, b = input().split()
print(int(a)*(round(float(b)*100))//100)
|
p03474 | s670109652 | Accepted | a,b=map(int,input().split())
s=input()
if len(s)==a+b+1 and s[a]=='-' and s.count('-')==1:
print('Yes')
else:
print('No') |
p03795 | s973827207 | Accepted | N = int(input())
print(N * 800 - (N // 15) * 200 ) |
p02860 | s079428552 | Accepted | n=int(input())
s=input()
m=0
if n%2==0:
for i in range(n//2):
if s[i]==s[i+n//2]:
m+=1
print("Yes" if m==(n/2) else "No") |
p03607 | s974970201 | Accepted | import collections
n=int(input())
a=[]
for _ in range(n):
a.append(input())
c=collections.Counter(a)
tmp=[]
for k,v in c.items():
if v%2!=0:
tmp.append(k)
print(len(tmp)) |
p02951 | s529272766 | Accepted | (a, b, c) = map(int, input().split())
ans = max(0, c - (a - b))
print(ans)
|
p03416 | s657115055 | Accepted | def is_palindromic(N):
N_reversed=list(str(N))
N_reversed.reverse()
N_reversed=int(''.join(N_reversed))
if N_reversed==N:
return True
else:
return False
A,B=map(int,input().split())
count=0
for i in range(A,B+1):
if is_palindromic(i):
count+=1
print(count) |
p02642 | s108096566 | Wrong Answer | N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N):
count = 0
for j in range(N):
if A[i]%A[j] != 0 and i != j:
count += 1
if count == N-1:
ans += 1
print(ans)
|
p02951 | s517022433 | Accepted | a, b, c = map(int, input().split())
if c - (a-b) < 0:
print("0")
else:
print(c-(a-b)) |
p02768 | s854776638 | Accepted | mod = 10**9 + 7
n, a, b = map(int, input().split())
total = pow(2, n, mod)-1
def mod_comb(n,k,p):
if n<0 or k<0 or n<k:
return 0
if n==0 or k==0:
return 1
a = 1
b = 1
for i in range(k):
a = (a*((n-i)%p))%p
b = (b*((i+1)%p))%p
return (a*pow(b,p-2,p))%p
x = mod_comb(n, a, mod)
y = mod_comb(n, b, mod)
total = (total-x-y)%mod
print(total) |
p02618 | s997646319 | Accepted | for _ in range(365):
print(1) |
p03486 | s983383643 | Accepted | s = ''.join(sorted(list(input())))
t = ''.join(sorted(list(input()), reverse=True))
if s < t:
print('Yes')
else:
print('No') |
p02571 | s864855663 | Accepted | S=input()
T=input()
a=[]
for i in range(len(S)-len(T)+1) :
count=0
for j in range(len(T)) :
if S[i:i+len(T)][j]==T[j] :
count+=1
a.append(count)
print(len(T)-max(a)) |
p02989 | s452523884 | Accepted | N=int(input())
D=list(map(int,input().split()))
D.sort()
K=D[N//2]-D[N//2-1]
print(K) |
p03814 | s265848699 | Accepted | def main():
S = input()
L, R = 1001001, 0
for i in range(len(S)):
if S[i] == 'A' and L > i:
L = i
if S[i] == 'Z' and R < i:
R = i
print(R - L + 1)
if __name__ == '__main__':
main()
|
p03760 | s943826808 | Wrong Answer | O=input()
E=input()
N=len(O)
M=len(E)
ans=""
for i in range(N):
ans+=O[i]
if N-M==1 and i==M-1:
break
ans+=E[i]
print(ans) |
p02909 | s225703111 | Accepted | S = input()
if S == "Sunny":
print("Cloudy")
elif S == "Cloudy":
print("Rainy")
else :
print("Sunny") |
p02873 | s491311454 | Wrong Answer | S=input()
A=[0]*(len(S)+1)
for i in range(len(S)):
if S[i]=='<':
A[i+1]=max(A[i+1],A[i]+1)
for i in range(len(S)-1,0,-1):
if S[i]=='>':
A[i]=max(A[i],A[i+1]+1)
print(sum(A))
|
p03261 | s834944174 | Wrong Answer | n = int(input())
w = [input() for i in range(n)]
if len(set(w)) == n:
for i in range(1, n):
s0 = list(w[i - 1])
s1 = list(w[i])
if s1[0] == s0[-1]:
pass
else:
print("NO")
exit()
print("Yes")
else:
print("No") |
p03042 | s857125249 | Accepted | s=int(input())
a=s//100
b=s-a*100
if a<13 and b<13 and a>0 and b>0:
print("AMBIGUOUS")
elif a<13 and a>0:
print("MMYY")
elif b<13 and b>0:
print("YYMM")
else:
print("NA")
|
p03861 | s031182667 | Accepted | a,b,x = map(int,input().split())
ans = b//x - (a-1)//x
print(ans)
|
p03475 | s683233518 | Accepted | N = int(input())
CSF = []
import math
for i in range(N-1):
CSF.append(list(map(int,input().split())))
def time(t,i):
if CSF[i][1] >= t:
return CSF[i][1]+CSF[i][0]
else:
x = math.ceil((t-CSF[i][1])/CSF[i][2])
return CSF[i][1]+ x*CSF[i][2] + CSF[i][0]
for i in range(N-1):
t = CSF[i][0]+CSF[i][1]
for j in range(i+1,N-1):
t = time(t,j)
print(t)
print(0) |
p04011 | s183282130 | Wrong Answer | # 入力
n = int(input())
k = int(input())
x = int(input())
y = int(input())
# 処理
first_stay = k * x
second_stay = (n - k) * y
total = first_stay + second_stay
print(total) |
p02790 | s342630473 | Accepted | a=sorted(input().split())
print(a[0]*int(a[1])) |
p03323 | s847461653 | Accepted | a, b = map(int, input().split())
if a <= 8 and b <= 8:
print("Yay!")
else:
print(":(") |
p03910 | s874805594 | Accepted | n = int(input())
s = 0
for i in range(1, n+1):
s += i
if s >= n:
break
k = s-n
ans = []
for j in range(1, i+1):
if j == k:
continue
else:
ans.append(j)
ans = list(map(str, ans))
print('\n'.join(ans))
|
p03317 | s910854218 | Wrong Answer | import math
def resolve():
n, k = map(int, input().split())
a = list(map(int, input().split()))
i = a.index(min(a))
v = math.ceil(i/(k-1)) + math.ceil((n-1-i)/(k-1))
print(v)
resolve() |
p03485 | s736549358 | Accepted | import math
a, b = map(int, input().split())
print(math.ceil((a+b)/2)) |
p02696 | s251448360 | Wrong Answer | a, b, n = map(int, input().split())
if n>=b:
print(int(a*b/b) - a*int(b/b))
else:
print(int(a*n/b) - a*int(n/b)) |
p03998 | s511090784 | Wrong Answer | s = [input() for _ in range(3)]
d = {'a': 0, 'b': 1, 'c': 2}
nxt, cnt = 0, [0, 0, 0]
for _ in range(sum(len(si) for si in s)):
now = nxt
nxt = d[s[now][cnt[now]]]
cnt[now] += 1
if len(s[nxt]) <= cnt[nxt]:
print(['A', 'B', 'C'][now])
break
|
p03679 | s062833180 | Accepted | LI = lambda: list(map(int, input().split()))
X, A, B = LI()
def main():
x = B - A
if x <= 0:
ans = "delicious"
elif x <= X:
ans = "safe"
else:
ans = "dangerous"
print(ans)
if __name__ == "__main__":
main()
|
p02555 | s391636791 | Accepted | n = int(input())
mod = 10 ** 9 + 7
dp = [0] * 2001
dp[3] = 1
dp[4] = 1
dp[5] = 1
if n >= 6:
for i in range(6,n+1):
dp[i] = (dp[i-1] + dp[i-3]) % mod
print(dp[n]) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.