# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
597618 |
2022-07-16T12:08:49 Z |
l_reho |
Poi (IOI09_poi) |
C++14 |
|
670 ms |
18216 KB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int N, K, P;
vector<vector<int>> V;
vector<int> S;
bool compare(array<int, 3> a1, array<int, 3> a2){
return a1[0] < a2[0] || ((a1[0] == a2[0] && a1[1] < a2[1]) || (a1[1] < a2[1] && a1[2] < a2[2]));
}
void solve(){
cin>>N>>K>>P;
V.assign(N, vector<int>(K, 0));
S.assign(K, 0);
for(int i = 0; i < N; i++)
for(int j = 0; j < K; j++) cin>>V[i][j];
for(int i = 0; i < K; i++){
for(int j = 0; j < N; j++){
S[i]+=V[j][i];
}
S[i] = N-S[i];
}
vector<array<int, 3>> A(N);
// faccio cose
for(int i = 0; i < N; i++){
int points = 0, solved = 0;
for(int j = 0; j < K; j++){
solved += V[i][j];
if(V[i][j]) points += S[j];
}
A[i] = array<int,3>{points, solved, i};
}
sort(A.begin(), A.end(), compare);
for(int i = 0; i < N; i++) if(A[i][2] == P-1){cout<<A[i][0]<<" "<<i+1<<endl; break;}
}
int main(){
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
300 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
304 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
212 KB |
Output isn't correct |
9 |
Incorrect |
3 ms |
340 KB |
Output isn't correct |
10 |
Incorrect |
5 ms |
468 KB |
Output isn't correct |
11 |
Incorrect |
26 ms |
980 KB |
Output isn't correct |
12 |
Incorrect |
35 ms |
1476 KB |
Output isn't correct |
13 |
Incorrect |
102 ms |
3796 KB |
Output isn't correct |
14 |
Incorrect |
127 ms |
5284 KB |
Output isn't correct |
15 |
Incorrect |
244 ms |
8108 KB |
Output isn't correct |
16 |
Incorrect |
267 ms |
8596 KB |
Output isn't correct |
17 |
Incorrect |
409 ms |
11584 KB |
Output isn't correct |
18 |
Incorrect |
474 ms |
13040 KB |
Output isn't correct |
19 |
Incorrect |
561 ms |
16628 KB |
Output isn't correct |
20 |
Incorrect |
670 ms |
18216 KB |
Output isn't correct |