제출 #346628

#제출 시각아이디문제언어결과실행 시간메모리
346628AlexandraPoi (IOI09_poi)Cpython 3
40 / 100
2079 ms38440 KiB
(n, t, p) = input().split() (n, t , p) = int (n), int(t), int (p) problems_solved = [] grading = [] scores=[] empates=[] PorEncima=0 TieBreak1=[] TieBreak2=[] for i in range (n): a = input().split() a = list(map(int, a)) problems_solved.append(a) for i in range (t): a = 0 for j in range (n): a += problems_solved[j][i] grading.append(n - a) for i in range(n): a = 0 for j in range(t): if problems_solved[i][j]==1: a += grading[j] scores.append(a) score_Philip = scores[p-1] for i in range(n): if (i+1)==p: continue else: if score_Philip == scores[i]: empates.append(i+1) a = 0 for j in range (t): a += problems_solved[i][j] TieBreak1.append(a) elif score_Philip < scores[i]: PorEncima += 1 if empates==[]: print (str(score_Philip) + " " + str(1+PorEncima)) else: empates.append(p) a=0 for i in range (t): a += problems_solved[p-1][i] TieBreak1.append(a) for i in range(len(empates)-1): if TieBreak1[i] == TieBreak1[(len(empates)-1)]: TieBreak2.append(empates[i]) elif TieBreak1[i] < TieBreak1[len(empates-1)]: PorEncima += 1 if (TieBreak2)==[]: print (str(score_Philip) + " " + str(1+PorEncima)) else: TieBreak2.append(p) TieBreak2.sort() a=TieBreak2.index(p) print (str(score_Philip) + " " + str(1+PorEncima+a))
#Verdict Execution timeMemoryGrader output
Fetching results...