#include<bits/stdc++.h>
using namespace std;
#define ll long long
bool cmp(pair<int, int> &a, pair<int, int> &b)
{
if(a.second != b.second)
{
return a.second>b.second;
}
else
{
if(a.first != b.first)
{
return a.first<b.first;
}
}
return 0;
}
int main()
{
int n, t, p;
cin>>n >>t >>p;
vector<int> points_for_each_task_array(t, 0);
vector<vector<int> > arr(n, {0, 0});
vector<pair<int, int>> final_standing(n, {0, 0});
for(int i=0; i<n; i++)
{
for(int j=0; j<t; j++)
{
cin>>arr[i][j];
if(arr[i][j]==0)
{
points_for_each_task_array[j]++;
}
}
}
for(int i=0; i<n; i++)
{
int j=0, ans=0;
for(j=0; j<t; j++)
{
if(arr[i][j]==1)
{
ans+=points_for_each_task_array[j];
}
}
final_standing[i]={i, ans};
}
sort(final_standing.begin(), final_standing.end(), cmp);
cout<<final_standing[p-1].second <<" " <<final_standing[p-1].first+1;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
3 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
4 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
5 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
6 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
7 |
Runtime error |
2 ms |
432 KB |
Execution killed with signal 6 |
8 |
Runtime error |
2 ms |
340 KB |
Execution killed with signal 6 |
9 |
Runtime error |
4 ms |
468 KB |
Execution killed with signal 6 |
10 |
Runtime error |
5 ms |
468 KB |
Execution killed with signal 6 |
11 |
Runtime error |
18 ms |
672 KB |
Execution killed with signal 6 |
12 |
Runtime error |
31 ms |
820 KB |
Execution killed with signal 6 |
13 |
Runtime error |
83 ms |
1584 KB |
Execution killed with signal 6 |
14 |
Runtime error |
112 ms |
2124 KB |
Execution killed with signal 6 |
15 |
Runtime error |
194 ms |
3416 KB |
Execution killed with signal 6 |
16 |
Runtime error |
229 ms |
3676 KB |
Execution killed with signal 6 |
17 |
Runtime error |
315 ms |
5164 KB |
Execution killed with signal 6 |
18 |
Runtime error |
394 ms |
5180 KB |
Execution killed with signal 6 |
19 |
Runtime error |
485 ms |
5204 KB |
Execution killed with signal 6 |
20 |
Runtime error |
531 ms |
5220 KB |
Execution killed with signal 6 |