# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
239127 | T0p_ | Poi (IOI09_poi) | C++14 | 425 ms | 24144 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;
struct DATA
{
int score, num, no;
bool operator < (const DATA & o) const{
return (score != o.score) ? score < o.score : ((num != o.num) ? num < o.num : no > o.no);
}
};
int result[2020][2020], score[2020], point[2020], sum[2020];
priority_queue<DATA> heap;
int main()
{
int n, t, p;
scanf(" %d %d %d",&n,&t,&p);
for(int i=1 ; i<=t ; i++) score[i] = n;
for(int i=1 ; i<=n ; i++)
for(int j=1 ; j<=t ; j++)
{
scanf(" %d",&result[i][j]);
score[j] -= result[i][j];
}
for(int i=1 ; i<=n ; i++)
for(int j=1 ; j<=t ; j++)
{
point[i] += score[j] * result[i][j];
sum[i] += result[i][j];
}
for(int i=1 ; i<=n ; i++)
heap.push({point[i], sum[i], i});
for(int i=1 ; i<=n ; i++)
{
if(heap.top().no == p)
{
printf("%d %d\n",heap.top().score, i);
return 0;
}
heap.pop();
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |