# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
956626 | DeltaStruct | Poi (IOI09_poi) | C++17 | 469 ms | 31828 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<int> C(n); iota(C.rbegin(),C.rend(),m*n); for (int i(0);i < n;++i) for (int k(0);k < m;++k) C[i] += A[i][k]*B[k]*n*(m+1)-A[q-1][k]*n;
int r = C[q-1]; sort(C.begin(),C.end(),greater<int>());
cout << r/n/(m+1) << ' ' << upper_bound(C.begin(),C.end(),r,greater<int>())-C.begin() << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |