# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
994310 | ducksaysquack | Poi (IOI09_poi) | C++98 | 157 ms | 31832 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>
#define int long long
#define f first
#define s second
using namespace std;
signed main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, k, p; cin >> n >> k >> p;
vector<vector<int>> v(n, vector<int>(k)); vector<int> a(k); vector<pair<pair<int,int>,int>> b(n);
for(int i=0;i<n;i++) for(int j=0;j<k;j++) {cin >> v[i][j]; a[j] += 1-v[i][j];}
for(int i=0;i<n;i++) for(int j=0;j<k;j++) b[i].f.f += a[j]*v[i][j], b[i].f.s += v[i][j], b[i].s = -i;
sort(begin(b),end(b),greater<pair<pair<int,int>,int>>());
for(int i=0;i<n;i++) if(b[i].s == 1-p) cout << b[i].f.f << ' ' << i+1 << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |