Submission #443681

#TimeUsernameProblemLanguageResultExecution timeMemory
443681BelguteiPoi (IOI09_poi)C++17
100 / 100
884 ms12060 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define ff first #define ss second #define pb push_back #define mk make_pair #define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n,t,p; bool b[2005][2005]; ll cnt[2005]; ll point[2005]; int main(){ cin>>n>>t>>p; for(int i=1; i<=n; i++){ for(int j=1; j<=t; j++){ cin>>b[i][j]; // person / task } } for(int i=1; i<=t; i++){ int a=0; for(int j=1; j<=n; j++){ if(b[j][i]==1) a++; } a=n-a; for(int j=1; j<=n; j++){ if(b[j][i]==1){ point[j]+=a; cnt[j]++; } } } cout<<point[p]<<" "; int ans=1; for(int i=1; i<=n; i++){ if(point[i]>point[p]) ans++; if(i!=p){ if(point[i]==point[p]){ if(cnt[i]>cnt[p]) ans++; else{ if(cnt[i]==cnt[p]){ if(i<p) ans++; } } } } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...