문제

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AXNP4CvauaMDFAXS&categoryId=AXNP4CvauaMDFAXS&categoryType=CODE

풀이

비교하면서 카운팅을 진행하고, 카운팅 된 결과를 출력하면 된다.

T = int(input())
for test_case in range(1, T+1):
    
    n, nlist, count = int(input()), list(map(int, input().split())), 0
    for l in nlist:
        if l <= sum(nlist)//n:
            count += 1
    
    print('#'+str(test_case), count)

댓글남기기