Submission #402009

#TimeUsernameProblemLanguageResultExecution timeMemory
402009AzimjonPoi (IOI09_poi)C++17
100 / 100
315 ms31724 KiB
// 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 timeMemoryGrader output
Fetching results...