본문 바로가기
python-algorithm

백준 5800 성적 통계

by 무적김두칠 2021. 12. 6.

1
2
3
4
5
6
7
8
9
10
11
12
for i in range(int(input())):
    tmp=list(map(int,input().split()))
    listLen=tmp[0]
    tmp.pop(0)
    mymax=max(tmp)
    mymin=min(tmp)
    tmp=sorted(tmp)
    gap=0
    for j in range(1,len(tmp)):
        gap=max(tmp[j]-tmp[j-1],gap)
    print("Class %d"%(i+1))
    print("Max %d, Min %d, Largest gap %d"%(mymax,mymin,gap))
cs
반응형

'python-algorithm' 카테고리의 다른 글

백준 10867 중복 빼고 정렬하기  (0) 2021.12.06
백준 7785 회사에 있는 사람  (0) 2021.12.06
백준 5671 호텔 방 번호  (0) 2021.12.06
백준 5635 생일  (0) 2021.12.06
백준 2822 점수 계산  (0) 2021.12.06

댓글