Submission #851657

#TimeUsernameProblemLanguageResultExecution timeMemory
851657abcvuitunggioPoi (IOI09_poi)C++17
100 / 100
201 ms4236 KiB
#include <bits/stdc++.h>
using namespace std;
int n,t,p,cnt[2001];
bool a[2001][2001];
pair <pair <int, int>, int> s[2001];
int main(){
    ios_base::sync_with_stdio(NULL);cin.tie(nullptr);
    cin >> n >> t >> p;
    for (int i=1;i<=n;i++)
        for (int j=1;j<=t;j++){
            cin >> a[i][j];
            cnt[j]+=1-a[i][j];
        }
    for (int i=1;i<=n;i++){
        for (int j=1;j<=t;j++){
            s[i].first.first-=a[i][j]*cnt[j];
            s[i].first.second-=a[i][j];
        }
        s[i].second=i;
    }
    sort(s+1,s+n+1);
    for (int i=1;i<=n;i++)
        if (s[i].second==p)
            cout << -s[i].first.first << ' ' << i;
}
#Verdict Execution timeMemoryGrader output
Fetching results...