| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 659774 | ivopav | Poi (IOI09_poi) | C++14 | 668 ms | 8724 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;
int main(){
    int n;
    int t;
    int p;
    cin >> n >> t >> p;
    vector<vector<bool>> mat={};
    vector<int> lis=vector<int>(t,0);
    for (int i=0;i<n;i++){
        mat.push_back({});
        for (int j=0;j<t;j++){
            bool unos;
            cin >> unos;
            mat[i].push_back(unos);
            lis[j]+=(int)(!unos);
        }
    }
   // cout << "-----------------\n";
    vector<pair<int,pair<int,int>>> lis2={};
    for (int i=0;i<n;i++){
        lis2.push_back({0,{0,i}});
        for (int j=0;j<t;j++){
            lis2[i].first-=lis[j]*(int)(mat[i][j]);
            lis2[i].second.first-=(int)(mat[i][j]);
        }
    }
    sort(lis2.begin(),lis2.end());
    for (int i=0;i<lis2.size();i++){
       // cout << lis2[i].first << " " << lis2[i].second.first << " " << lis2[i].second.second << "\n";
        if (lis2[i].second.second==p-1){
            cout << -lis2[i].first << " " << i+1 << "\n";
        }
    }
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
