| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 532898 | alextodoran | Poi (IOI09_poi) | C++17 | 275 ms | 11996 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.
/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m, k;
    cin >> n >> m >> k; k--;
    bool solved[n][m];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> solved[i][j];
        }
    }
    int points[m];
    for (int j = 0; j < m; j++) {
        points[j] = 0;
        for (int i = 0; i < n; i++) {
            points[j] += !solved[i][j];
        }
    }
    ll score[n];
    int cnt[n];
    for (int i = 0; i < n; i++) {
        score[i] = 0;
        cnt[i] = 0;
        for (int j = 0; j < m; j++) {
            if (solved[i][j]) {
                cnt[i]++;
                score[i] += points[j];
            }
        }
    }
    int better = 0;
    for (int i = 0; i < n; i++) {
        if (i != k) {
            if (score[i] != score[k]) {
                better += (score[i] > score[k]);
            } else if (cnt[i] != cnt[k]) {
                better += (cnt[i] > cnt[k]);
            } else {
                better += (i < k);
            }
        }
    }
    cout << score[k] << " " << 1 + better << "\n";
    return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
