Submission #685063

#TimeUsernameProblemLanguageResultExecution timeMemory
685063acceptifyPoi (IOI09_poi)C++17
70 / 100
512 ms23792 KiB
#include <bits/stdc++.h>
using namespace std;

const int mxn = 2005;
const int mxt = 2005;

int n, t, p, ac[mxn][mxt], pt[mxt], scr[mxn], rk[mxn];

int main() {
    cin >> n >> t >> p;
    for (int i = 1; i <= n; i++) for (int j = 1; j <= t; j++) {
        cin >> ac[i][j];
        pt[j] += 1 - ac[i][j];
    }
    for (int i = 1; i <= n; i++) for (int j = 1; j <= t; j++) scr[i] += ac[i][j] * pt[j];
    for (int i = 1; i <= n; i++) rk[i] = i;
    sort(rk + 1, rk + n + 1, [](int x, int y) -> bool {
        if (scr[x] != scr[y]) return scr[x] > scr[y];
        return x < y;
    });
    cout << scr[p] << " ";
    for (int i = 1; i <= n; i++) if (rk[i] == p) cout << i << "\n";
}
#Verdict Execution timeMemoryGrader output
Fetching results...