본문 바로가기
Programming

현대_Softeer_level3_성적 평가_파이썬

by WelcomeBro 2023. 1. 17.
반응형

문제 링크

 

파이썬

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import sys
 
def who_champ(now_list):
    new_list = now_list[::]
    new_list.sort(reverse=True)
    ans = [0 for i in range(len(now_list))]
    fuck_dict = {}
    real_rank = 0
    temp_score = 3001
    for k in new_list:
        if temp_score>k:
            real_rank +=1
            fuck_dict[k] = real_rank
            temp_score = k
        elif temp_score==k:
            real_rank +=1
            
    for i in now_list:
        print(fuck_dict[i],end=' ')
    print()
    
how_many = int(sys.stdin.readline())
first = False
answer = ''
for i in sys.stdin:
    a = list(map(int,i.split(" ")))    
    who_champ(a)
    if first == False:
        total_list = a
        first = True
    else:
        for a_i in range(how_many):
            total_list[a_i] += a[a_i]
who_champ(total_list)
cs

 

Be positive!

Be rich!

Live your life!

반응형