제출 #492292

#제출 시각아이디문제언어결과실행 시간메모리
492292asdfghjklPoi (IOI09_poi)C++11
0 / 100
527 ms40024 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...