| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 871937 | _uros9 | Poi (IOI09_poi) | C++17 | 236 ms | 39668 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>
#define int long long
#define endl '\n'
using namespace std;
signed main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,t,p;
    cin >> n >> t >> p;
    vector<vector<int>> matr(n,vector<int>(t));
    for(auto&x:matr){
        for(auto&xx:x)
            cin >> xx;
    }
    vector<int> poeni(t,0);
    for(int j=0; j<t; j++){
        for(int i=0; i<n; i++){
            if(matr[i][j]==0)
                poeni[j]++;
        }
    }
    vector<pair<pair<int,int>,int>> niz(n);
    for(int i=0; i<n; i++){
        int br_poena=0;
        for(int j=0; j<t; j++){
            if(matr[i][j]==1)
                br_poena+=poeni[j];
        }
        niz[i]={{-br_poena,-count(matr[i].begin(),matr[i].end(),1)},i};
    }
    sort(niz.begin(),niz.end());
    for(int i=0; i<n; i++){
        if(niz[i].second==p-1)
            cout << -niz[i].first.first << " " << i+1;
    }
    return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
