제출 #956640

#제출 시각아이디문제언어결과실행 시간메모리
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...