Submission #444639

#TimeUsernameProblemLanguageResultExecution timeMemory
444639FEDIKUSPoi (IOI09_poi)C++17
100 / 100
333 ms23812 KiB
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define pf push_front #define popb pop_back #define popf pop_front #define xx first #define yy second #define srt(a) sort(a.begin(),a.end()); #define srtg(a,int) sort(a.begin(),a.end(),greater<int>()) #define lb(a,x) lower_bound(a.begin(),a.end(),x) #define up(a,x) upper_bound(a.begin(),a.end(),x) #define fnd(a,x) find(a.begin(),a.end(),x) #define vstart auto startt=chrono::system_clock::now() #define vend auto endd=chrono::system_clock::now() #define vvreme chrono::duration<double> vremee=endd-startt #define ios ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef string str; const int maxn=2010; int resilo[maxn]; int brp[maxn]; int ulaz[maxn][maxn]; int uradio[maxn]; void solve(){ int n,t,p; cin>>n>>t>>p; for(int i=1;i<=n;i++){ for(int j=1;j<=t;j++){ cin>>ulaz[i][j]; if(ulaz[i][j]){ resilo[j]++; uradio[i]++; } } } for(int i=1;i<=n;i++){ for(int j=1;j<=t;j++){ if(ulaz[i][j]) brp[i]+=n-resilo[j]; } } int koji=1; for(int i=1;i<=n;i++){ if(brp[i]==brp[p]){ if(uradio[i]==uradio[p]){ koji+=i<p; }else koji+=uradio[i]>uradio[p]; }else koji+=brp[i]>brp[p]; } cout<<brp[p]<<" "<<koji; } int main(){ ios; int t=1; //cin>>t; while(t--) solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...