Submission #1119786

#TimeUsernameProblemLanguageResultExecution timeMemory
1119786kasdoPoi (IOI09_poi)C++14
0 / 100
452 ms39656 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int maxn = 2005; int a[maxn][maxn], scores[maxn]; int n, t, p; signed main() { cin>>n>>t>>p; for(int i=0; i<n; i++) { for(int j=0; j<t; j++) { cin>>a[i][j]; scores[j] += a[i][j]; } } for(int i=0; i<t; i++) scores[i] = n - scores[i]; vector<int> v; for(int i=0; i<n; i++) { int cur = 0; for(int j=0; j<t; j++) { if (a[i][j] == 1) cur += scores[j]; } v.push_back(cur); } int ans = v[p - 1]; sort(v.begin(), v.end()); for(int i=0; i<n; i++) { if (v[i] == ans) { cout<<ans<<" "<<i + 1<<endl; return 0; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...