# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
851657 | abcvuitunggio | Poi (IOI09_poi) | C++17 | 201 ms | 4236 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int n,t,p,cnt[2001];
bool a[2001][2001];
pair <pair <int, int>, int> s[2001];
int main(){
ios_base::sync_with_stdio(NULL);cin.tie(nullptr);
cin >> n >> t >> p;
for (int i=1;i<=n;i++)
for (int j=1;j<=t;j++){
cin >> a[i][j];
cnt[j]+=1-a[i][j];
}
for (int i=1;i<=n;i++){
for (int j=1;j<=t;j++){
s[i].first.first-=a[i][j]*cnt[j];
s[i].first.second-=a[i][j];
}
s[i].second=i;
}
sort(s+1,s+n+1);
for (int i=1;i<=n;i++)
if (s[i].second==p)
cout << -s[i].first.first << ' ' << i;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |