# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
631118 | chinmoy_101 | Poi (IOI09_poi) | C++14 | 537 ms | 8524 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;
#define ll long long
int main()
{
int n, t, p;
cin>>n >>t >>p;
vector<int> points_for_each_task_array(t, 0);
vector<vector<int> > arr(n, {0, 0});
vector<pair<int, pair<int, int> > > final_standing(n, {0, {0, 0}}); // score, solves, -id
//vector<pair<int, pair<int, int>> > final_standing(n, {0, {0, 0}});
for(int i=0; i<n; i++)
{
for(int j=0; j<t; j++)
{
cin>>arr[i][j];
if(arr[i][j]==0)
{
points_for_each_task_array[j]++;
}
}
}
for(int i=0; i<n; i++)
{
int ans=0, no_of_problems_solved=0;
for(int j=0; j<t; j++)
{
if(arr[i][j]==1)
{
ans+=points_for_each_task_array[j];
no_of_problems_solved++;
}
}
final_standing[i]={ans, {no_of_problems_solved, -i-1}};
}
sort(final_standing.begin(), final_standing.end());
reverse(final_standing.begin(), final_standing.end());
for(int i=0; i<n; i++)
{
if(final_standing[i].second.second==-p)
{
cout<<final_standing[i].first <<" " <<i+1 <<"\n";
return 0;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |