Submission #232350

#TimeUsernameProblemLanguageResultExecution timeMemory
232350cfalasPoi (IOI09_poi)C++14
100 / 100
833 ms16120 KiB
#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 timeMemoryGrader output
Fetching results...