python-algorithm
백준 5800 성적 통계
무적김두칠
2021. 12. 6. 15:32
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 |
반응형