# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
631120 |
2022-08-17T17:28:38 Z |
chinmoy_101 |
Poi (IOI09_poi) |
C++14 |
|
552 ms |
15956 KB |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n, t, p;
cin>>n >>t >>p;
int points_for_each_task_array[t];
memset(points_for_each_task_array, 0, sizeof points_for_each_task_array);
int arr[n][n];
vector<pair<int, pair<int, int> > > final_standing(n, {0, {0, 0}}); // score, solves, -id
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 |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Incorrect |
3 ms |
212 KB |
Output isn't correct |
10 |
Correct |
5 ms |
340 KB |
Output is correct |
11 |
Incorrect |
17 ms |
596 KB |
Output isn't correct |
12 |
Correct |
29 ms |
1236 KB |
Output is correct |
13 |
Incorrect |
93 ms |
2132 KB |
Output isn't correct |
14 |
Correct |
135 ms |
4204 KB |
Output is correct |
15 |
Incorrect |
208 ms |
5932 KB |
Output isn't correct |
16 |
Correct |
236 ms |
6908 KB |
Output is correct |
17 |
Incorrect |
331 ms |
9100 KB |
Output isn't correct |
18 |
Correct |
383 ms |
11612 KB |
Output is correct |
19 |
Correct |
503 ms |
15956 KB |
Output is correct |
20 |
Correct |
552 ms |
15956 KB |
Output is correct |