# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1005750 | 12345678 | Poi (IOI09_poi) | C++17 | 146 ms | 23888 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>
using namespace std;
const int nx=2e3+5;
int n, t, x, s[nx][nx], cnt[nx], v[nx], sv[nx];
vector<pair<int, pair<int, int>>> res;
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n>>t>>x;
for (int i=1; i<=n; i++) for (int j=1; j<=t; j++) cin>>s[i][j], cnt[j]+=1-s[i][j];
for (int i=1; i<=n; i++) for (int j=1; j<=t; j++) v[i]+=s[i][j]*cnt[j], sv[i]+=s[i][j];
for (int i=1; i<=n; i++) res.push_back({v[i], {sv[i], -i}});
sort(res.begin(), res.end());
reverse(res.begin(), res.end());
for (int i=0; i<n; i++) if (res[i].second.second==-x) return cout<<res[i].first<<' '<<i+1, 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |