| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|
| 1213547 |  | xaa29 | Poi (IOI09_poi) | Pypy 3 |  | 403 ms | 86664 KiB | 
N, T, P = map(int, input().split())
results = []
for _ in range(N):
    row = list(map(int, input().split()))
    results.append(row)
tasks_scores = {}
for x in results:
    for y in range(T):
        if x[y] == 0:
            tasks_scores[y] = tasks_scores.get(y, 0) + 1
def get_score(ID, results, T,scores):
    score = 0
    for t in range(T):
        r = results[ID][t]
        if r == 1:
            score = score + scores[t]
    return score
final = {}
for c in range(N):
    final[c] = get_score(c, results, T, tasks_scores)
sorted_final = dict(sorted(final.items(), key=lambda item: item[1], reverse=True))
place = (next(i for i, (k, v) in enumerate(sorted_final.items()) if k == (P - 1))) + 1
score = get_score(P - 1, results, T,tasks_scores)
print(score, place)
Compilation message (stdout)
Compiling 'poi.py'...
=======
  adding: __main__.pyc (deflated 36%)
=======
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |