Submission #956639

#TimeUsernameProblemLanguageResultExecution timeMemory
956639DeltaStructPoi (IOI09_poi)C++17
80 / 100
472 ms39756 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]; sort(C.begin(),C.end(),greater<pair<int,int>>()); cout << r.first << ' ' << find(C.begin(),C.end(),r)-C.begin()+count(C.begin(),C.end(),r) << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...