Submission #956614

#TimeUsernameProblemLanguageResultExecution timeMemory
956614DeltaStructPoi (IOI09_poi)C++17
65 / 100
476 ms16212 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n,m,q; cin >> n >> m >> q; vector A(n,vector<int>(m)); vector<int> B(m,n); for (int i(0);i < n;++i) for (int k(0);k < m;++k) (cin>>A[i][k]),B[k]-=A[i][k]; vector<int> C(n); iota(C.rbegin(),C.rend(),0); for (int i(0);i < n;++i) for (int k(0);k < m;++k) C[i] += A[i][k]*B[k]*n; sort(C.begin(),C.end(),greater<int>()); int r(n-q); for (int k(0);k < m;++k) r += A[q-1][k]*B[k]*n; cout << r/n << ' ' << upper_bound(C.begin(),C.end(),r,greater<int>())-C.begin() << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...