Submission #440174

#TimeUsernameProblemLanguageResultExecution timeMemory
440174dxz05Poi (IOI09_poi)C++14
0 / 100
814 ms11992 KiB
#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2022;

bool solved[MAXN][MAXN];
int cnt[MAXN];

pair<pair<int, int>, int> a[MAXN];

int main(){
    int N, M, P;
    cin >> N >> M >> P;

    fill(cnt, cnt + M, N);

    for (int i = 0; i < N; i++){
        for (int j = 0; j < M; j++){
            cin >> solved[i][j];
            cnt[j] -= solved[i][j];
        }
    }

    for (int i = 0; i < N; i++){
        for (int j = 0; j < M; j++){
            if (solved[i][j]){
                a[i].first.first += cnt[j];
                a[i].first.second++;
            }
        }
        a[i].second = i + 1;
    }

    sort(a, a + N);

    for (int i = 0; i < N; i++){
        if (a[i].second == P){
            cout << a[i].first.first << ' ' << i + 1 << endl;
            return 0;
        }
    }

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...