# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
402009 | Azimjon | Poi (IOI09_poi) | C++17 | 315 ms | 31724 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.
// Muallif: Azimjon Mehmonali o'g'li
#include <bits/stdc++.h>
using namespace std;
#define int long long
const long double PI = 3.1415926535897;
const int mod = 1000000007LL;
const int INF = 1e18;
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, t, p;
cin >> n >> t >> p;
vector<vector<int>> g(n + 1, vector<int>(t + 1));
vector<int> tq(t + 1, n);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= t; j++) {
cin >> g[i][j];
tq[j] -= g[i][j];
}
}
vector<pair<pair<int, int>, int>> v;
for (int i = 1; i <= n; i++) {
int imq = 0, ims = 0;
for (int j = 1; j <= t; j++) {
ims += g[i][j];
imq += g[i][j] * tq[j];
}
v.push_back({{-imq, -ims}, i});
}
sort(v.begin(), v.end());
for (int i = 0; i < n; i++) {
if (v[i].second == p) {
cout << -v[i].first.first << " " << i + 1 << endl;
return 0;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |