# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
592935 | Mahtimursu | Poi (IOI09_poi) | C++17 | 209 ms | 9632 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>
typedef long long ll;
#define M 1000000007
#define N (1 << 18)
using namespace std;
int score[2001];
vector<int> solved[2001];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, t, p;
cin >> n >> t >> p;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= t; ++j) {
int x;
cin >> x;
if (x == 0) score[j]++;
else solved[i].push_back(j);
}
}
vector<pair<int, pair<int, int>>> v;
for (int i = 1; i <= n; ++i) {
int sc = 0;
for (int x : solved[i]) sc += score[x];
v.push_back({sc, {solved[i].size(), -i}});
}
sort(v.rbegin(), v.rend());
for (int i = 0; i < n; ++i) {
if (v[i].second.second == -p) {
cout << v[i].first << " " << i + 1 << "\n";
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |