# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
956640 | DeltaStruct | Poi (IOI09_poi) | C++17 | 470 ms | 31812 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |