Submission #835989

#TimeUsernameProblemLanguageResultExecution timeMemory
835989HanksburgerPoi (IOI09_poi)C++17
0 / 100
189 ms23744 KiB
#include <bits/stdc++.h> using namespace std; pair<pair<int, int>, int> a[2005]; int x[2005][2005], s[2005]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m, k; cin >> n >> m >> k; for (int i=1; i<=n; i++) { for (int j=1; j<=m; j++) { cin >> x[i][j]; if (!x[i][j]) s[j]++; } } for (int i=1; i<=n; i++) { a[i].second=i; for (int j=1; j<=m; j++) { if (x[i][j]) { a[i].first.first+=s[j]; a[i].first.second++; } } } sort(a+1, a+n+1); for (int i=1; i<=n; i++) if (a[i].second==k) cout << a[i].first.first << ' ' << i; }
#Verdict Execution timeMemoryGrader output
Fetching results...