#include<bits/stdc++.h>
#define fi first
#define se second
using namespace std;
const int N=2e3;
struct W
{
int s,c,id;
bool operator<(const W &oth)
{
if(s==oth.s && c==oth.c)
return id<oth.id;
else if(s==oth.s)
return c>oth.c;
return s>oth.s;
}
};
int sc[N+10];
int tab[N+10][N+10];
W w[N+10];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n,t,p;
cin>>n>>t>>p;
for(int i=1;i<=t;i++)
sc[i]=n;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=t;j++)
{
cin>>tab[i][j];
if(tab[i][j])
sc[j]--;
}
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=t;j++)
{
w[i].s+=tab[i][j]*sc[j];
w[i].c+=tab[i][j];
}
w[i].id=i;
}
sort(w+1,w+n+1);
for(int i=1;i<=n;i++)
{
if(w[i].id==p)
{
cout<<w[i].s<<" "<<p<<"\n";
break;
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
332 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
460 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
588 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
600 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
716 KB |
Output isn't correct |
10 |
Incorrect |
5 ms |
1284 KB |
Output isn't correct |
11 |
Incorrect |
12 ms |
2224 KB |
Output isn't correct |
12 |
Incorrect |
22 ms |
3408 KB |
Output isn't correct |
13 |
Incorrect |
54 ms |
6564 KB |
Output isn't correct |
14 |
Incorrect |
80 ms |
9276 KB |
Output isn't correct |
15 |
Incorrect |
126 ms |
12664 KB |
Output isn't correct |
16 |
Incorrect |
130 ms |
13660 KB |
Output isn't correct |
17 |
Incorrect |
196 ms |
16776 KB |
Output isn't correct |
18 |
Incorrect |
211 ms |
19036 KB |
Output isn't correct |
19 |
Incorrect |
286 ms |
23048 KB |
Output isn't correct |
20 |
Incorrect |
342 ms |
23904 KB |
Output isn't correct |