# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
346629 | Alexandra | Poi (IOI09_poi) | Cpython 3 | 2088 ms | 35112 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
(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
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
TieBreak2.append(p)
TieBreak2.sort()
a=TieBreak2.index(p)
print (str(score_Philip) + " " + str(1+PorEncima+a))
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |