Submission #956640

#TimeUsernameProblemLanguageResultExecution timeMemory
956640DeltaStructPoi (IOI09_poi)C++17
100 / 100
470 ms31812 KiB
#include <bits/stdc++.h> using namespace std; int main(){ #define int long long 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<pair<int,int>> C(n); for (int i(0);i < n;++i) for (int k(0);k < m;++k) C[i].first += A[i][k]*B[k],C[i].second+=A[i][k]; auto r = C[q-1]; int t = count(C.begin(),C.begin()+q,r); sort(C.begin(),C.end(),greater<pair<int,int>>()); cout << r.first << ' ' << find(C.begin(),C.end(),r)-C.begin()+t << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...