# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
492292 | asdfghjkl | Poi (IOI09_poi) | C++11 | 527 ms | 40024 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<iostream>
#include<locale>
#include <iomanip>
#include<fstream>
#include<cmath>
#include<string>
using namespace std;
int main()
{
int n, t, p, temp=0;
cin>>n>>t>>p;
int TT[n][t], Kk[t], Z[n+1], L[n];
for (int i=1; i<=t+1; i++)
{
Kk[i]=0;
L[i]=0;
Z[i]=0;
}
for (int i=1; i<=n; i++)
{
for (int o=1; o<=t; o++)
{
cin>>TT[i][o];
if (TT[i][o]==0) Kk[o]++;
}
}
for (int i=1; i<=n; i++)
{
for (int o=1; o<=t; o++)
{
if (TT[i][o]==1) {Z[i]+=Kk[o]; L[i]++;};
}
}
cout<<Z[p]<<" ";
temp=Z[p];
for (int i=0; i<n; i++)
{
if (Z[i]<Z[i+1]) swap (Z[i],Z[i+1]);
else if (Z[i]==Z[i+1])
{
if (L[i] < L[i+1]) {
swap (Z[i],Z[i+1]) ;
};
}
}
for (int i=1; i<=n-1; i++)
{
if (Z[i]==temp) {cout<<i<<endl;break;};
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |