# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
382122 | vishesh312 | Poi (IOI09_poi) | C++17 | 296 ms | 16108 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;
/*
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using ordered_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;
*/
#define all(x) begin(x), end(x)
#define sz(x) (int)x.size()
using ll = long long;
const int mod = 1e9+7;
void solve(int tc) {
int n, m, p;
cin >> n >> m >> p;
vector<vector<int>> v(n, vector<int>(m));
vector<int> point(m), score(n), cnt(n);
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
cin >> v[i][j];
point[j] += (v[i][j] == 0);
cnt[i] += v[i][j];
}
}
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
if (v[i][j]) score[i] += point[j];
}
}
vector<array<int, 3>> res(n);
for (int i = 0; i < n; ++i) {
res[i] = {-score[i], -cnt[i], i};
}
sort(all(res));
int i = 0;
while (res[i][2] != p-1) ++i;
cout << -res[i][0] << " " << i+1 << '\n';
}
signed main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int tc = 1;
//cin >> tc;
for (int i = 1; i <= tc; ++i) solve(i);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |