python2025
•
7:11 p.m. 4 Tháng 12, 2025
w
n, x = map(int, input().split())
A = list(map(int, input().split()))
cnt = {}
answer = 0
for value in A:
need = x - value
if need in cnt:
answer += cnt[need]
cnt[value] = cnt.get(value, 0) + 1
print(answer)
...Xem thêm
•
6:34 p.m. 25 Tháng 11, 2025
d
n=int(input())
n=n+1
print(2+(n*(n+1)//2-3))
...Xem thêm
•
6:21 p.m. 13 Tháng 11, 2025
ww
n=int(input())
print((n*3)-1)
...Xem thêm
s
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
print(a[k-1])
...Xem thêm