# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
659789 |
2022-11-19T09:28:14 Z |
Gabi88 |
Poi (IOI09_poi) |
C++14 |
|
510 ms |
16108 KB |
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define F first
#define S second
vector<pair<int, pair<int, int> > > v;
int n, m, k, l[2009][2009], rj[2009], na[2009], sum, usp = -1, pos = -1;
int main(){
cin >> n >> m >> k;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
cin >> l[i][j];
na[i] += l[i][j];
rj[j] += (l[i][j]+1)%2;
}
}
for(int i=0; i<n; i++){
sum = 0;
for(int j=0; j<m; j++) sum += rj[j]*l[i][j];
v.push_back(make_pair(sum, make_pair(na[i], i+1)));
}
sort(v.begin(), v.end());
sum = -1;
for(int i=0; i<n; i++){
if (sum != v[i].first or usp != v[i].second.first){
sum = v[i].first;
usp = v[i].second.first;
pos = i+1;
}
if (v[i].second.second == k){cout << sum << " " << pos; return 0;}
}
return 0;
}
/*
6 4 4
0 0 1 1
1 0 1 0
1 1 1 1
0 0 0 1
0 1 1 0
1 0 0 0
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
468 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
596 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
596 KB |
Output isn't correct |
9 |
Incorrect |
3 ms |
724 KB |
Output isn't correct |
10 |
Incorrect |
6 ms |
1236 KB |
Output isn't correct |
11 |
Incorrect |
17 ms |
1968 KB |
Output isn't correct |
12 |
Incorrect |
30 ms |
3020 KB |
Output isn't correct |
13 |
Incorrect |
84 ms |
5408 KB |
Output isn't correct |
14 |
Incorrect |
112 ms |
7628 KB |
Output isn't correct |
15 |
Incorrect |
197 ms |
9664 KB |
Output isn't correct |
16 |
Incorrect |
218 ms |
10492 KB |
Output isn't correct |
17 |
Incorrect |
318 ms |
12040 KB |
Output isn't correct |
18 |
Incorrect |
355 ms |
13708 KB |
Output isn't correct |
19 |
Incorrect |
477 ms |
16108 KB |
Output isn't correct |
20 |
Incorrect |
510 ms |
15952 KB |
Output isn't correct |