Submission #956609

#TimeUsernameProblemLanguageResultExecution timeMemory
956609DeltaStructPoi (IOI09_poi)C++17
0 / 100
474 ms16148 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),j;k < m;++k) (cin>>j),B[k]-=j; 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)-C.begin() << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...