# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
720334 | Yell0 | Poi (IOI09_poi) | C++17 | 266 ms | 12048 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 <bits/stdc++.h>
using namespace std;
int N,T,P,sc[2002],tot[2002],sol[2002],ans[2002];
bool a[2002][2002];
int main() {
ios::sync_with_stdio(0);cin.tie(0);
cin>>N>>T>>P;
for(int i=1;i<=N;++i)
for(int j=1;j<=T;++j)
cin>>a[i][j];
for(int i=1;i<=T;++i)
for(int j=1;j<=N;++j) sc[i]+=!a[j][i];
for(int i=1;i<=N;++i)
for(int j=1;j<=T;++j) {
tot[i]+=sc[j]*a[i][j];
sol[i]+=a[i][j];
}
iota(ans+1,ans+1+N,1);
sort(ans+1,ans+1+N,[](int x,int y) {return (tot[x]==tot[y]?(sol[x]==sol[y]?x<y:sol[x]>sol[y]):tot[x]>tot[y]);});
cout<<tot[P]<<' ';
for(int i=1;i<=N;++i) if(ans[i]==P) cout<<i<<'\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |