20240620

I wasn't expecting today would be this busy day.

It's super helpful that Django's extensions come with admin sites. API keys can be revoked on UI. Cron schedule can be adjusted on UI.

I didn't have much time to do things in the TODO list. I have some appointments tomorrow, but I hope I can continue to make process.

1946A. Median of an Array

It took me 3 hours to understand and solve this problem…

Coming up with an algorithm that counts the number of elements to be increased was difficult.

for _ in range(int(input())):
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    mid_i = n // 2 - 1 if n % 2 == 0 else n // 2
    mid = a[mid_i]
    mid_count = len([ai for ai in a if ai == mid])
    keep_count = 0
    for i in range(mid_i):
        if a[i] == mid:
            keep_count += 1
    print(mid_count - keep_count)

Protein shake 700 Sushi bowl 800 avocado 200

Total 1700 kcal

abs push ups


TODO:


index 20240619 20240621