#include<bits/stdc++.h>
#define st first
#define nd second
using namespace std;
const int N=2005;
int tab[N][N];
int sco[N];
int main(){
int n, m, t;
cin>>n>>m>>t;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
cin>>tab[i][j];
sco[j]+=1-tab[i][j];
}
}
vector<pair<int, int> > V;
int ans=0;
for(int i=0; i<n; i++){
int k=0;
for(int j=0; j<m; j++){
k+=sco[j]*tab[i][j];
}
if(i==t-1)ans=k;
V.push_back({k, i});
}
sort(V.begin(), V.end());
reverse(V.begin(), V.end());
cout<<ans<<" ";
for(int i=0; i<n; i++)if(V[i].st==ans){
cout<<i+1;
break;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
5 |
Correct |
2 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
460 KB |
Output is correct |
7 |
Incorrect |
2 ms |
588 KB |
Output isn't correct |
8 |
Correct |
3 ms |
588 KB |
Output is correct |
9 |
Incorrect |
4 ms |
716 KB |
Output isn't correct |
10 |
Correct |
7 ms |
1228 KB |
Output is correct |
11 |
Correct |
23 ms |
2172 KB |
Output is correct |
12 |
Incorrect |
39 ms |
3356 KB |
Output isn't correct |
13 |
Incorrect |
115 ms |
6596 KB |
Output isn't correct |
14 |
Incorrect |
166 ms |
9212 KB |
Output isn't correct |
15 |
Incorrect |
342 ms |
12644 KB |
Output isn't correct |
16 |
Correct |
313 ms |
13676 KB |
Output is correct |
17 |
Incorrect |
450 ms |
16704 KB |
Output isn't correct |
18 |
Correct |
517 ms |
18932 KB |
Output is correct |
19 |
Correct |
703 ms |
22988 KB |
Output is correct |
20 |
Correct |
770 ms |
23824 KB |
Output is correct |