| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 866276 | Bula | Poi (IOI09_poi) | C++14 | 497 ms | 23888 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/stdc++.h>
using namespace std;
main(){
    int n, m, p;
    cin >> n >> m >> p;
    int x[n + 1][m + 1];
    vector<int> a(m + 1);
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= m; j++){
            cin >> x[i][j];
        }
    }
    for(int i = 1; i <= m; i++){
        for(int j = 1; j <= n; j++){
            a[i] += (1 - x[j][i]);
        }
    }
    int sc = 0, pr = 0;
    for(int i = 1; i <= m; i++){
        if(x[p][i] == 1){
            sc += a[i];
            pr++;
        }
    }
    int cnt = 0;
    for(int i = 1; i <= n; i++){
        int cur = 0, prob = 0;
        for(int j = 1; j <= m; j++){
            if(x[i][j] == 1){
                cur += a[j];
                prob++;
            }
        }
        if(sc < cur){
            cnt++;
        }else if(sc == cur){
            if(prob > pr) cnt++;
            else if(prob == pr){
                if(p > i) cnt++;
            }
        }
    }
    cout << sc << " " << cnt + 1 << endl;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
