Submission #1005750

#TimeUsernameProblemLanguageResultExecution timeMemory
100575012345678Poi (IOI09_poi)C++17
100 / 100
146 ms23888 KiB
#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 timeMemoryGrader output
Fetching results...