# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
397592 | ak2006 | Poi (IOI09_poi) | C++14 | 751 ms | 23948 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;
using ll = long long;
using vb = vector<bool>;
using vvb = vector<vb>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vc = vector<char>;
using vvc = vector<vc>;
const ll mod = 1e9 + 7,inf = 1e18;
#define pb push_back
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
bool cmp(vi&a,vi&b)
{
return (a[0] > b[0]) || (a[0] == b[0] && a[1] > b[1]) || (a[0] == b[0] && a[1] == b[1] && a[2] < b[2]);
}
int main()
{
int n,t,p;
cin>>n>>t>>p;
vvi a(n,vi(t));
vi score(t);
for (int i = 0;i<n;i++)
for (int j = 0;j<t;j++)cin>>a[i][j],score[j] += 1 - a[i][j];
vvi consider(n,vi(3));
for (int i = 0;i<n;i++){
for (int j = 0;j<t;j++)if (a[i][j])consider[i][1]++,consider[i][0] += score[j];
consider[i][2] = i;
}
cout<<consider[p - 1][0]<<" ";
sort(consider.begin(),consider.end(),cmp);
for (int i = 0;i<n;i++){
if (consider[i][2] == p - 1){cout<<i + 1;return 0;}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |