| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 670732 | skittles1412 | Poi (IOI09_poi) | C++17 | 261 ms | 12012 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.
#include "bits/extc++.h"
using namespace std;
template <typename T>
void dbgh(const T& t) {
    cerr << t << endl;
}
template <typename T, typename... U>
void dbgh(const T& t, const U&... u) {
    cerr << t << " | ";
    dbgh(u...);
}
#ifdef DEBUG
#define dbg(...)                                           \
    cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]" \
         << ": ";                                          \
    dbgh(__VA_ARGS__)
#else
#define cerr   \
    if (false) \
    cerr
#define dbg(...)
#endif
#define endl "\n"
#define long int64_t
#define sz(x) int(std::size(x))
void solve() {
    int n, m, kv;
    cin >> n >> m >> kv;
    kv--;
    bool arr[n][m];
    for (auto& a : arr) {
        for (auto& b : a) {
            cin >> b;
        }
    }
    int score[m] {};
    for (auto& a : arr) {
        for (int i = 0; i < m; i++) {
            score[i] += !a[i];
        }
    }
    array<int, 3> sarr[n];
    for (int i = 0; i < n; i++) {
        int cs = 0, cnt = 0;
        for (int j = 0; j < m; j++) {
            if (arr[i][j]) {
                cnt++;
                cs += score[j];
            }
        }
        sarr[i] = {-cs, -cnt, i};
    }
    sort(sarr, sarr + n);
    for (int i = 0; i < n; i++) {
        if (sarr[i][2] == kv) {
            cout << -sarr[i][0] << " " << i + 1 << endl;
        }
    }
}
int main() {
    cin.tie(nullptr);
    cin.exceptions(ios::failbit);
    ios_base::sync_with_stdio(false);
    solve();
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
