Submission #492293

#TimeUsernameProblemLanguageResultExecution timeMemory
492293asdfghjklPoi (IOI09_poi)C++17
0 / 100
525 ms32084 KiB
#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 timeMemoryGrader output
Fetching results...