#include<bits/stdc++.h>
using namespace std;
#define ll long long int
bool cmp(pair<int, int>a, pair<int, int> b)
{
if(a.second>b.second)
return 1;
else
return 0;
}
int main()
{
int n, t, p;
cin>>n >>t >>p;
p--;
int arr[5][3]; //RXC
for(int i=0; i<n; i++)
{
for(int j=0; j<t; j++)
{
cin>>arr[i][j];
}
}
int points[t];
int cnt=0;
for(int i=0; i<n; i++)
{
for(int j=0; j<n; j++)
{
if(arr[j][i]==0)
{
cnt++;
}
}
points[i]=cnt;
cnt=0;
}
vector<pair<int, int>> v(n, {0, 0});
int ans=0;
for(int i=0; i<n; i++)
{
for(int j=0; j<t; j++)
{
if(arr[i][j]==1)
{
ans+=points[j];
}
}
v[i]={i, ans};
ans=0;
}
sort(v.begin(), v.end(), cmp);
cout<<v[p].second <<" " <<v[p].first+1;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
3 |
Runtime error |
1 ms |
432 KB |
Execution killed with signal 6 |
4 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
5 |
Runtime error |
1 ms |
432 KB |
Execution killed with signal 6 |
6 |
Runtime error |
565 ms |
6780 KB |
Execution killed with signal 11 |
7 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
8 |
Runtime error |
636 ms |
7312 KB |
Execution killed with signal 11 |
9 |
Runtime error |
3 ms |
468 KB |
Execution killed with signal 6 |
10 |
Runtime error |
3 ms |
436 KB |
Execution killed with signal 11 |
11 |
Runtime error |
3 ms |
400 KB |
Execution killed with signal 11 |
12 |
Runtime error |
7 ms |
532 KB |
Execution killed with signal 11 |
13 |
Runtime error |
18 ms |
656 KB |
Execution killed with signal 11 |
14 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
15 |
Runtime error |
56 ms |
1288 KB |
Execution killed with signal 11 |
16 |
Runtime error |
1 ms |
436 KB |
Execution killed with signal 11 |
17 |
Runtime error |
29 ms |
904 KB |
Execution killed with signal 11 |
18 |
Runtime error |
38 ms |
1100 KB |
Execution killed with signal 11 |
19 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
20 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |