Submission #252019

#TimeUsernameProblemLanguageResultExecution timeMemory
252019ScarletSPoi (IOI09_poi)C++17
70 / 100
297 ms12080 KiB
#include <bits/stdc++.h> #define ll long long #define sz(x) (int)(x).size() using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n,t,p,x; cin>>n>>t>>p; bool b[n][t]; for (int i=0;i<n;++i) for (int j=0;j<t;++j) cin>>b[i][j]; int a[t]; for (int i=0;i<t;++i) { a[i]=n; for (int j=0;j<n;++j) a[i]-=b[j][i]; } vector<pair<int,int>> v; for (int i=0;i<n;++i) { x=0; for (int j=0;j<t;++j) x+=a[j]*b[i][j]; v.push_back({x,-(i+1)}); } sort(v.rbegin(), v.rend()); for (int i=0;i<n;++i) if (v[i].second==-p) cout<<v[i].first<<" "<<i+1<<"\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...