# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
232350 | cfalas | Poi (IOI09_poi) | C++14 | 833 ms | 16120 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.
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define INF 10000000
#define MOD 1000000007
#define MID (l+r)/2
#define HASHMOD 2305843009213693951
#define ll long long
#define ull unsigned long long
#define F first
#define S second
typedef pair<ll, ll> ii;
typedef pair<ii, int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef map<int, int> mii;
#define EPS 1e-6
#define T double
typedef complex<T> pt;
#define x real()
#define y imag()
T dot(pt v, pt w) {return (conj(v)*w).x;}
T cross(pt v, pt w) {return (conj(v)*w).y;}
T orient(pt a, pt b, pt c) {return cross(b-a,c-a);}
T dist(pt a, pt b) {return abs(a-b);}
int main(){
int n, m, k;
cin>>n>>m>>k;
int a[n][m];
for(int i=0;i<n;i++){
for(int j=0;j<m;j++) cin>>a[i][j];
}
int scnt[m] = {};
for(int i=0;i<n;i++){
for(int j=0;j<m;j++) if(a[i][j]==0) scnt[j]++;
}
pair<ii, int> sc[n];
for(int i=0;i<n;i++){
sc[i].F = ii(0,0);
sc[i].S = i;
for(int j=0;j<m;j++){
if(a[i][j]) sc[i].F.F-=scnt[j], sc[i].F.S--;
}
}
sort(sc, sc+n);
for(int i=0;i<n;i++){
if(sc[i].S==k-1) cout<<-sc[i].F.F<<" "<<i+1<<endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |