problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p02577 | s366823502 | Wrong Answer | N = input()
sum = sum([int(i) for i in N])
if sum % 9 == 0:
print('YES')
else:
print('NO')
|
p03994 | s174220779 | Accepted | s = list(input())
k = int(input())
for i in range(len(s)):
if s[i] != "a" and (123-ord(s[i])) <= k:
k -= (123-ord(s[i]))
s[i] = "a"
if i == len(s)-1:
s[i] = (chr((((ord(s[i])+(k%26))-97)%26)+97))
print("".join(s)) |
p02838 | s176207190 | Accepted | n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
ans = 0
for i in range(60):
c = sum([1 for ai in a if (ai >> i) & 1])
ans += (1 << i) * c * (n-c)
ans %= mod
print(ans) |
p03126 | s917756965 | Wrong Answer | N,M = map(int, input().split())
A=[]
for i in range(N):
x = [int(i) for i in input().split()]
A = A + x[1:]
ans = 0
from collections import Counter
for k,v in Counter(A).items():
print(k,v)
if v==N: ans += 1
print(ans)
|
p03161 | s382503906 | Accepted | #frog1からジャンプの回数が変数kになった
n,k=map(int,input().split())
h=list(map(int,input().split()))
INF=float('INF')
dp=[INF]*n
dp[0]=0
for i in range(1,n):
for j in range(1,k+1):
if i-j<0:#out of indexを防ぐ
continue
dp[i]=min(dp[i],dp[i-j]+abs(h[i]-h[i-j]))#dp[i]と大小を比較する
print(dp[n-1]) |
p02971 | s780031794 | Wrong Answer | N = int(input())
A = [int(input()) for _ in range(N)]
B = sorted(A)
m1 = B[-1]
m2 = B[-2]
ANS = [m1 if x == m1 else m2 for x in A]
print('\n'.join(map(str,ANS)))
|
p02621 | s933407420 | Accepted | a = int(input())
print(a + a**2 + a**3) |
p02787 | s509499338 | Accepted |
import numpy as np
H, N = list(map(int, input().split()))
A = np.empty(N, int)
B = np.empty(N, int)
for i in range(N):
A[i], B[i] = list(map(int, input().split()))
DP = np.empty(H+1, int)
DP[0] = 0
for i in range(1, H+1):
I = i-A;
I[I<0] = 0
DP[i] = np.min(DP[I] + B)
print(DP[H]) |
p03352 | s481157379 | Accepted | x = int(input())
ans = [1]
for i in range(2, 40):
for j in range(2, 10):
if i**j <= x:
ans.append(i**j)
else:
break
ans.sort()
print(ans[-1])
|
p02622 | s390697704 | Accepted | S= input()
T= input()
L= len(S)
ans = 0
for n in range(L):
if S[n] != T[n]:
ans += 1
print(ans) |
p02661 | s510926899 | Accepted | ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))
import statistics as st
n = ii()
a = []
b = []
for i in range(n):
aa,bb = mi()
a.append(aa)
b.append(bb)
a.sort()
b.sort()
minmed = st.median(a)
maxmed = st.median(b)
if len(a) %2 == 0:
an... |
p02924 | s338867809 | Accepted | n = int(input())
ans = n * (n - 1) // 2
print(ans) |
p03107 | s437063481 | Accepted | s = input()
red = s.count("0")
blue = s.count("1")
print(min(red,blue) * 2) |
p02831 | s252729322 | Accepted | import fractions
A, B = map(int,input().split())
def lcm(a,b):
y = a*b / fractions.gcd(a,b)
return int(y)
print(lcm(A,B)) |
p03860 | s912207494 | Accepted | S = input().split()
print(''.join([s[0].upper() for s in S])) |
p03221 | s723030110 | Accepted | import bisect
N,M = map(int,input().split())
A = [[] for _ in range(N)] #重複がある場合にはsetにする?
original = []
for i in range(M):
a,b = map(int,input().split())
a-=1 #県を0indexに直す
A[a].append(b)
original.append((a,b))
for X in A:
X.sort()
#print(A)
for i in range(M):
ken,now = original[i]
ID = bisect.bisect_left(... |
p02761 | s551791844 | Accepted | N, M = map(int, input().split())
if N==1 and M==0:
print(0)
import sys
sys.exit()
ans = [-1]*N
for i in range(M):
s,c = map(int,input().split())
if ans[s-1]!=-1 and ans[s-1]!=c:
print(-1)
break
ans[s-1] = c
else:
for i in range(N):
if ans[i]==-1:
if i!=0:
ans[i] = 0
else:
... |
p02640 | s590097979 | Wrong Answer | x, y = list(map(int, input().split()))
b = y // 2
a = y // 4
if y % 2 != 0:
print("No")
else:
if a <= x <= b:
print("Yes")
else:
print("No") |
p03760 | s627785949 | Accepted | o=input()
e=input()
n=max(len(o),len(e))
ans=''
for i in range(n):
if len(o)>len(e):
ans+=o[i]
if i!=n-1:
ans+=e[i]
else:
ans+=o[i]
ans+=e[i]
print(ans) |
p02819 | s862724708 | Accepted | import math
X = int(input())
def prime(a):
for i in range(2, math.floor(math.sqrt(a)) + 1):
if a % i == 0:
return True
return False
while prime(X):
X += 1
print(X) |
p02603 | s262149205 | Wrong Answer | N = int(input())
A = list(map(int, input().split()))
total = 1000
kabu = 0
for i in range(N-1):
if (A[i] < A[i+1]):
kabu += total//A[i]
total -= kabu*A[i]
elif(A[i]==A[i+1]):
pass
elif(A[i] > A[i+1]):
total += (kabu*A[i])
kabu = 0
#最後
i += 1
total += (kabu * A[i... |
p03377 | s749446486 | Wrong Answer | a,b,x = map(int,input().split())
if a + b >= x:
print("YES")
else:
print("NO") |
p02572 | s518501837 | Accepted | n=int(input())
a=[int(x) for x in input().split()]
b=[0]*n
b[0]=a[0]
for i in range(n-1):
b[i+1]=b[i]+a[i+1]
c=0
for j in range(n-1):
c+=a[j]*(b[n-1]-b[j])
print(c%(10**9+7)) |
p02831 | s646935865 | Wrong Answer | num = [int(s) for s in input().split()]
com = 1
tes = 2
if max(num)%min(num) == 0:
print(max(num))
else:
while tes < min(num)/2 +1:
if min(num)%tes == 0 and max(num)%tes == 0:
com *= tes
num = [int(n/tes) for n in num]
else:
tes += 1
print(com*min(num)*max(num)) |
p03556 | s872295028 | Wrong Answer | import math
n = int(input())
for i in range(n+1,1,-1):
#print(i)
if int((math.sqrt(i)))**2 == i:
print(i)
break |
p03076 | s407081120 | Accepted | arr = [0]*5
for i in range(5):
arr[i] = int(input())
time = 0
for ar in arr:
time += (-(-ar//10))*10
amari = []
for i in arr:
amari.append(i%10)
amari.sort()
while 0 in amari:
amari.remove(0)
if amari == []:
amari.append(10)
print(time - (10-amari[0]))
|
p03434 | s043520617 | Accepted | N = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
Alice = 0
Bob = 0
for i in range(N):
if i % 2 == 0:
Alice += a[i]
else:
Bob += a[i]
print(Alice - Bob) |
p03760 | s279673414 | Wrong Answer | #その10
O = str(input())
E = str(input())
P = []
for i in range(len(O)):
print(P)
print(i)
P.append(O[i])
if i < len(E):
P.append(E[i])
print(''.join(P)) |
p02696 | s475933679 | Wrong Answer | from math import floor,sqrt
import sys
a,b,n=map(int,input().split())
t1=floor((a*(n-1))/b)-a*floor((n-1)/b)
t2=floor(a*n/b)-a*floor(n/b)
print(max(t1,t2)) |
p04044 | s529741134 | Accepted | n,l = (int(x) for x in input().split())
dict = []
for i in range(0,n):
str = input()
dict.append(str)
# print(i)
# print(dict)
dict.sort()
# print(dict)
print("".join(dict)) |
p02833 | s586037384 | Wrong Answer | n = int(input())
if n % 2 == 1:
ans = 0
else:
ans = int(n // 10) + int(n // 50) + int(n // 250)
print(ans) |
p02640 | s455710532 | Accepted | x,y=map(int,input().split())
flag=False
for i in range(x):
c=2*i+4*(x-i)
C=4*i+2*(x-i)
if c==y or C==y:
flag=True
if flag:
print('Yes')
else:
print('No') |
p02691 | s414971108 | Accepted | import sys
def inpl(): return list(map(int, sys.stdin.readline().split()))
n = int(sys.stdin.readline())
a = inpl()
dic ={}
res = 0
for i in range(n):
res += dic.get(i - a[i], 0)
dic[i + a[i]] = dic.get(i + a[i], 0) + 1
print(res) |
p02726 | s170536106 | Accepted | N,X,Y=map(int,input().split())
X-=1
Y-=1
A=[0]*(N-1)
for i in range(N-1):
for j in range(i+1,N):
a=min(j-i,abs(j-Y)+1+abs(X-i))
A[a-1]+=1
for i in A:
print(i)
|
p02860 | s415920523 | Accepted | N = int(input())
S = list(input())
ans = 'No'
n = int(N / 2)
if S[:n] == S[n:]:
ans = 'Yes'
print(ans) |
p03126 | s258662272 | Accepted | n, m = map(int, input().split())
a = []
foods = set(range(1, m+1))
for i in range(n):
ki, *ai = list(map(int, input().split()))
a.append(set(ai))
for i in range(n):
foods &= a[i]
print(len(foods)) |
p02658 | s064894317 | Accepted | N=int(input())
A=sorted([int(x) for x in input().split()],reverse=True)
if A[-1]==0:
print(0)
else:
m=1
for a in A:
m*=a
if m>10**18:
break
print(m if m<=10**18 else -1)
|
p02760 | s132296869 | Accepted | a=[list(map(int,input().split())) for i in range(3)]
n=int(input())
for _ in range(n):
b=int(input())
for i in range(3):
for j in range(3):
if a[i][j]==b:
a[i][j]=-1
for i in range(3):
if a[i][0]==a[i][1]==a[i][2]==-1:
print('Yes')
exit()
if a[0][i]==a[1][i]==a[2][i]==-1:
print('Ye... |
p03407 | s186314592 | Accepted | a, b, c = map(int, input().split())
if a + b >= c: print("Yes")
else: print("No") |
p02570 | s827901658 | Accepted | d,t,s=map(int,input().split())
print("Yes" if t*s>=d else "No") |
p04043 | s026621437 | Accepted | abc = list(map(int,input().split()))
if abc == [5,5,7]:
print('YES')
exit()
if abc == [7,5,5]:
print('YES')
exit()
if abc == [5,7,5]:
print('YES')
exit()
print('NO')
|
p03705 | s033303393 | Wrong Answer | n,a,b=map(int,input().split())
if b<a:
print(0)
exit()
if a==b:
print(1)
exit()
n-=2
if n<0:
print(0)
if n==0:
print(1)
print(b*n-a*n+1) |
p03607 | s163527190 | Wrong Answer | N = int(input())
A = [int(input()) for _ in range(N)]
from collections import Counter
counter = dict(Counter(A))
ans = 0
for a in A:
if counter[a] % 2 == 1:
ans += 1
print(ans) |
p03524 | s789906665 | Accepted | s = input()
a = s.count("a")
b = s.count("b")
c = s.count("c")
check = min(a,b,c) + 1
if check < a or check < b or check < c:
print("NO")
else:
print("YES") |
p02640 | s083064492 | Accepted | x, y = map(int,input().split())
# 鶴をp羽とする
p = 0
for p in range(x+1):
if 2*p + 4*(x-p) - y == 0:
p=x+5
break
else:
x=x
if p==x+5:
print("Yes")
else:
print("No") |
p03262 | s290732490 | Accepted | N, X = map(int,input().split())
A = map(int,input().split())
s = 0
def gcd(a,b):
if b == 0:
return a
return gcd(b,a%b)
for i in A:
s = gcd(abs(X-i), s)
print(s)
|
p03774 | s364606745 | Accepted | N,M = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(N)]
cd = [list(map(int,input().split())) for _ in range(M)]
for i in range(N):
ans = []
for j in range(M):
ans.append(abs(ab[i][0]-cd[j][0]) + abs(ab[i][1]-cd[j][1]))
minans = min(ans)
print(ans.index(minans)+1) |
p02578 | s975271433 | Wrong Answer | n = int(input())
As = list(map(int, input().split()))
h = 0
for i in range(n - 1):
d = As[i + 1] - As[i]
if d > 0:
h += d
print(h) |
p02712 | s421220724 | Accepted | def Int():
return int(input())
def Ints():
return map(int,input().split())
def IntList():
return list(Ints())
def IntMat(N):
return [IntList() for i in range(N)]
ans = 0
N = Int()
for i in range(1,N+1):
if i%3!=0 and i%5!=0:
ans += i
print(ans) |
p03862 | s926521997 | Accepted | import sys
input = sys.stdin.readline
N, x = map(int, input().split())
a = list(map(int, input().split()))
res = 0
for i in range(1, N):
if a[i - 1] + a[i] > x:
t = a[i - 1] + a[i] - x
res += t
if t > a[i]:
t -= a[i]
a[i] = 0
a[i - 1] -= t
else:
a[i] -= t
print(res) |
p03377 | s069699502 | Wrong Answer | A,B,X = map(int,input().split())
print('YES' if B >= X else 'NO')
|
p02607 | s656349982 | Wrong Answer | n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(1, n, 2):
if a[i] % 2 == 1:
ans += 1
print(ans) |
p02983 | s743900223 | Wrong Answer | L, R = map(int, input().split())
def mod(num):
return num % 2019
# (2019a + x)(2019b + y) = 2019(n) + xy
if mod(L) * mod(R) == 0:
print(0)
elif L // 2019 != R // 2019:
print(0)
else:
print(min(mod(L * (L + 1)), mod((R - 1) * R))) |
p03067 | s520000379 | Accepted | def main():
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
#from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq... |
p03252 | s367750256 | Accepted | s=list(input())
t=list(input())
n=len(s)
ch=0
ch1=0
ans=0
d={}
d1={}
st=1
st1=1
s_new=[]
t_new=[]
for i in range(n):
if s[i] not in d:
d[s[i]]=st
st+=1
for g in range(n):
if t[g] not in d1:
d1[t[g]]=st1
st1+=1
for h in range(n):
s_new.append(d[s[h]])
t_new.append(d1[t[h]])
if s... |
p02554 | s257599940 | Wrong Answer | MOD = 10**9+7
n = int(input())
print(pow(10, n, MOD)-2*pow(9, n, MOD)+pow(8, n, MOD))
|
p03038 | s320015989 | Accepted | import sys
input = sys.stdin.readline
n,m = map(int,input().split())
A = list(map(int,input().split()))
BC = [tuple(map(int,input().split())) for i in range(m)]
BC = sorted(BC,key=lambda x:-x[1])
cnt = 0
flag = True
while True:
for b,c in BC:
A += [c]*b
cnt += b
if cnt > n:
brea... |
p03379 | s884976672 | Accepted | n = int(input())
x = list(map(int,input().split()))
y = sorted(x)
for i in x:
if y[(n+1)//2-1] >= i:
print(y[(n+1)//2])
else:
print(y[(n+1)//2-1]) |
p03449 | s550981567 | Accepted | N = int(input())
l1 = [int(i) for i in input().split(" ")]
l2 = [int(i) for i in input().split(" ")]
l1_sum = l1[0]
l2_sum = sum(l2)
Max = l1_sum + l2_sum
for i in range(1,N):
l1_sum += l1[i]
l2_sum -= l2[i-1]
if Max<l1_sum+l2_sum:
Max = l1_sum+l2_sum
print(Max) |
p03254 | s918515708 | Accepted | #!/usr/bin/env python
n, x = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
if x < a[0]:
print(0)
exit()
cnt = 0
al = False
for i in range(n):
if x >= a[i]:
x -= a[i]
cnt += 1
else:
break
if i == n-1:
al = True
if al:
if x > 0:
... |
p03059 | s547108058 | Wrong Answer | A,B,T = map(int,input().split())
print((T+0.5)//A * B) |
p03565 | s436882600 | Wrong Answer | s = str(input())
t = str(input())
lst = []
i= 0
for ss in range(len(s)-len(t)+1):
flg = 1
i= 0
for tt in range(len(t)):
now = ss + tt
if s[now] == t[tt] or s[now] == '?':
pass
else:
flg = 0
if flg:
ns = list(s)
ns[ss:now+1] = list(t)
lst.append(("").join(ns))
if lst:
lst = ... |
p02712 | s350584868 | Accepted | a = int(input())
li = list(range(1, (a + 1)))
for i in range(a):
if li[i] % 3 == 0 or li[i] % 5 == 0 or li[i] % 15 == 0:
li[i] = 0
print(sum(li)) |
p02582 | s985417302 | Accepted | s = input()
if 'RRR' in s:
print(3)
elif 'RR' in s:
print(2)
elif 'R' in s:
print(1)
else:
print(0) |
p03069 | s697783695 | Wrong Answer | import copy
n = int(input())
s0 = list(input())
s1 = copy.deepcopy(s0)
ans0, ans1 = 0, 0
for i in range(n-1, 0, -1):
if s0[i] == '.' and s0[i-1] == '#':
ans0 += 1
s0[i] = '#'
for i in range(n-1, 0, -1):
if s1[i] == '.' and s1[i-1] == '#':
ans1 += 1
s1[i-1] = '.'
print(min(ans0,... |
p02730 | s910121195 | Wrong Answer | S = input()
def judge(x):
if reversed(x) == x and x[0] == x[2] and x[-3] == x[-1]:
return "Yes"
else:
return "No"
print(judge(S)) |
p03449 | s246411071 | Accepted | n = int(input())
up = list(map(int,input().split()))
dw = list(map(int,input().split()))
ans = up[0]+sum(dw)
tmp = up[0]+sum(dw)
for i in range(1,n):
tmp = tmp+up[i]-dw[i-1]
ans = max(tmp,ans)
print(ans) |
p02843 | s851828614 | Accepted | #-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
def main():
X = int(input())
C = X // 100
if X >= C * 100 and X <= C * 105:
print(1)
else:
print(0)
if __name__=="__main__":
main() |
p03672 | s289271771 | Accepted | S = input()
for i in range(200):
S = S[:len(S)-1]
if S[len(S)//2:]==S[:len(S)//2]:
print(len(S))
exit() |
p03377 | s098815411 | Accepted | a, b, x = map(int, input().split())
if a <= x and x <= a+ b:
print('YES')
else:
print('NO') |
p03481 | s921009607 | Wrong Answer | import math
x,y = map(int,input().rstrip().split(' '))
n = int(math.log2(y//x))
print(n+1)
|
p02712 | s527492341 | Accepted | a = int(input())
num_list = []
for i in range(a):
i +=1
if i%3 != 0:
if i%5 != 0:
num_list.append(i)
print(sum(num_list)) |
p02760 | s434736143 | Accepted | *a,=map(int,open(0).read().split());print('YNeos'[all(t-set(a.index(b)for b in a[10:])for t in({0,1,2},{0,3,6},{0,4,8},{1,4,7},{2,4,6},{2,5,8},{3,4,5},{6,7,8}))::2]) |
p03417 | s287522762 | Accepted | N, M = map(int, input().split(' '))
if N == 1 and M == 1:
print(1)
elif N == 1 or M == 1:
print(max(0, M * N - 2))
else:
print(max(0, N * M - (2 * (N + M - 2))))
|
p03605 | s227896093 | Accepted | N=str(input())
print('Yes' if N[0]=='9' or N[1]=='9' else 'No') |
p02900 | s599525317 | Wrong Answer | n,m= list(map(int, input().split()))
def kouyaku(x,y):
table=[]
z=min(x,y)
for i in range(2,z+1):
if x%i==0 and y%i==0:
table.append(i)
table = list(set(table))
return table
k=kouyaku(n,m)
ans=0
for j in range(len(k)-1):
for z in range(j+1,len(k)):
if k[j]%k[z]!=0:... |
p03627 | s847421986 | Wrong Answer | import collections
n = int(input())
p = list(map(int,input().split()))
cnt = collections.Counter(p)
maxs = []
for k, v in cnt.items():
if v > 1:
maxs.append(k)
if len(maxs) > 1:
maxs.sort()
print(maxs[-1] * maxs[-2])
else:
print(0) |
p02784 | s200577787 | Wrong Answer | H, N = map(int, input().split())
count = 0
arr = list(map(int, input().split()[:N]))
attack = H
for i in range(N):
attack = attack - arr[i]
count = count + 1
i = i + 1
if attack <= 0 and count > 1:
print("Yes")
else:
print("No") |
p03351 | s893871226 | Wrong Answer | a, b, c, d = list(map(int, input().split()))
if (c-a) > d or a == c:
print("Yes")
elif (b-a) > d and (b-c) > d:
print("Yes")
elif a == b and b == c:
print("Yes")
else:
print("No") |
p02582 | s420501210 | Accepted | x = input()
a = [int(x[i]=='R') for i in range(3)]
s = sum(a)
if(s==2 and a[1]==0):
s = 1
print(s) |
p03069 | s947070620 | Accepted | n = int(input())
s = input()
ans = 0
w = s.count('.')
b = 0
ans = w+b
for c in s:
if c=='#':
b += 1
else:
w -= 1
ans = min(ans, w+b)
print(ans)
|
p03657 | s683766633 | Wrong Answer | a, b = map(int, input().split())
if (a + b)%3 == 0:
print('Possible')
else:
print('Impossible') |
p03721 | s882704999 | Wrong Answer | n,k = map(int,input().split())
A = [0]*n
B = [0]*n
for i in range(n):
ta,tb = map(int,input().split())
A[i] = ta
B[i] = tb
count = k
for i in range(n):
count -= B[i]
if count <= 0:
print(A[i])
break |
p02729 | s478399914 | Accepted | # coding: utf-8
# Your code here!
N, M = [int(i) for i in input().split()]
cnt = 0
cnt += (N*(N-1))//2
cnt += (M*(M-1))//2
print(cnt) |
p04034 | s898516519 | Wrong Answer | from collections import defaultdict
n,m=map(int, input().split())
v = [0]*n
v[0]=1
ans = [1]*n
fi = 1
for i in range(m):
a,b=map(int, input().split())
ans[a-1]-=1
ans[b-1]+=1
if ans[a-1]==0 and v[a-1]:
if v[b-1]:fi-=1
else:v[b-1]=1
if ans[a-1]>0 and v[a-1]:
fi+=1
v[b... |
p02584 | s230569234 | Accepted | from sys import stdin,stdout
input = stdin.readline
def write(n,sep="\n"):
stdout.write(str(n))
stdout.write(sep)
def gil():
return list(map(int, input().split()))
X, K, D = map(int, input().split())
X = abs(X)
if X >= K * D:
print(abs(X - K * D))
exit()
mov = X // D
if abs(X-mov*D) > abs(X-(mov+1)*D):
... |
p03038 | s304834059 | Accepted | n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
x=[]
for i in range(m):
b,c=map(int,input().split())
x.append([b,c])
y=sorted(x,key=lambda x:(x[1],x[0]),reverse=True)
d=[]
cnt=0
for i in range(m):
cnt+=y[i][0]
d.extend([y[i][1]]*y[i][0])
if cnt>n:
break
for i in rang... |
p03136 | s456691630 | Accepted | n=int(input())
a=[int(i) for i in input().split()]
b=sorted(a)
x=sum(b[-1:])
y=sum(b[:-1])
if y>x:
print('Yes')
else:
print('No') |
p04030 | s842570771 | Wrong Answer | s=input()
if s.rfind('0')>s.rfind('1'):
a='0'
else:
a='1'
s=s.replace('0B','').replace('1B','').replace('B','')
if s=='':
print(a)
else:
print(s) |
p02583 | s962890536 | Accepted | n=int(input())
a=list(map(int,input().split()))
s=0
b=[]
for i in range(n):
for j in range(i+1,n):
for k in range(j+1,n):
if a[i]!=a[j] and a[j]!=a[k] and a[k]!=a[i] and a[i]+a[j]>a[k] and a[i]+a[k]>a[j] and a[j]+a[k]>a[i]:
s+=1
print(s)
|
p02622 | s082397263 | Wrong Answer | a = input()
b = input()
c = 0
d = 0
for i in a:
if b[c] == i:
d = d+1
c=c+1
else:
c=c+1
print(d) |
p02693 | s750958978 | Accepted | K = int(input())
A, B =map(int, input().split())
for i in range(A, B+1):
if i % K == 0:
print("OK")
exit()
print("NG") |
p03001 | s187419491 | Accepted | W, H, x, y = map(int, input().split())
if x == W/2 and y == H/2:
menseki = W*H/2
print(menseki,1)
else:
menseki = W*H/2
print(menseki,0) |
p03011 | s402205424 | Wrong Answer | p, q, r = map(int, input().split())
print(min(p + q, p + r, r + p)) |
p02719 | s221910655 | Accepted | N, K = map(int, input().split(' '))
print(min(N % K, abs((N % K) - K))) |
p02897 | s567124901 | Wrong Answer | n=int(input())
if n!=1 and n%2==0:
print(0.5)
elif n!=1 and n%2!=0:
print((n/2+1)/n*2)
else:
print(1) |
p02829 | s908863450 | Accepted | A = int(input())
B = int(input())
print(6-A-B) |
p03069 | s488105837 | Wrong Answer | import sys
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')
N = I()
S = input()
ans1 = INF
idx = S.find('#')
if idx >= 0:
ans1 = S[idx + 1:].count('.')
ans2 = 0
fo... |
p02753 | s968019224 | Accepted | S = input()
if S == 'AAA' or S == 'BBB':
print('No')
else:
print('Yes') |
p03109 | s543145742 | Accepted | day = input()
if int(day[5:7]) < 5:
print("Heisei")
else:
print("TBD") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.