# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
655600 | horiseun | Poi (IOI09_poi) | C++11 | 265 ms | 4292 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 <iostream>
#include <vector>
#include <tuple>
#include <algorithm>
using namespace std;
int n, t, p;
bool solved[2005][2005];
int score[2005];
vector<tuple<int, int, int>> v;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> n >> t >> p;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= t; j++) {
cin >> solved[i][j];
}
}
for (int i = 1; i <= t; i++) {
for (int j = 1; j <= n; j++) {
score[i] += (!solved[j][i]);
}
}
for (int i = 1; i <= n; i++) {
int temp = 0, c = 0;
for (int j = 1; j <= t; j++) {
temp += (solved[i][j] ? score[j] : 0);
c += solved[i][j];
}
v.push_back({temp, c, -i});
}
sort(v.begin(), v.end(), greater<tuple<int, int, int>>());
for (int i = 0; i < v.size(); i++) {
if (get<2>(v[i]) == -p) {
cout << get<0>(v[i]) << " " << i + 1 << "\n";
return 0;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |