# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
335585 | Joshc | Poi (IOI09_poi) | C++11 | 494 ms | 23916 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 <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int l[2001][2001], v[2001];
int main() {
int n, t, p;
scanf("%d%d%d", &n, &t, &p);
for (int i=1; i<=n; i++) {
for (int j=1; j<=t; j++) scanf("%d", &l[i][j]);
}
for (int i=1; i<=t; i++) {
for (int j=1; j<=n; j++) v[i] += !l[j][i];
}
vector<pair<int, pair<int, int> > > x;
for (int i=1; i<=n; i++) {
int a=0, b=0;
for (int j=1; j<=t; j++) {
a += l[i][j]*v[j];
b += l[i][j];
}
x.push_back({-a, {-b, i}});
}
sort(x.begin(), x.end());
for (int i=0; i<n; i++) {
if (x[i].second.second == p) printf("%d %d\n", -x[i].first, i+1);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |