# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
717745 |
2023-04-02T12:00:50 Z |
VMaksimoski008 |
Poi (IOI09_poi) |
C++14 |
|
188 ms |
332 KB |
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
void setIO()
{
ios_base::sync_with_stdio(false);
cout.tie(0);
cin.tie(0);
}
bool cmp(pair<int, int> a, pair<int, int> b)
{
if(a.second != b.second)
return (a.second < b.second);
else
return (a.first < b.first);
}
int main()
{
setIO();
int n, t, p, x;
int totalPoints = 0;
cin >> n >> t >> p;
vector<int> taskPoints(t+1, n);
vector<int> phillipSolved;
vector<pair<int, int> > rankList;
for(int i=0; i<n; i++)
{
for(int j=0; j<t; j++)
{
cin >> x;
if(x == 1)
taskPoints[j+1] -= 1;
if(i+1 == p)
{
if(x == 1)
phillipSolved.pb(j+1);
}
}
}
for(int h : phillipSolved)
totalPoints += taskPoints[h];
for(int i=1; i<=n; i++)
{
rankList.pb({i, 0});
for(int j=1; j<=t; j++)
{
rankList[rankList.size()-1].second += taskPoints[j];
}
}
sort(rankList.begin(), rankList.end(), cmp);
int phillipRank = 0;
for(auto a : rankList)
{
phillipRank++;
if(a.first == p)
break;
}
cout << totalPoints << " " << phillipRank << '\n';
return 0;
}
/*
5 3 2
0 0 1
1 1 0
1 0 0
1 1 0
1 1 0
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
212 KB |
Output isn't correct |
11 |
Incorrect |
7 ms |
212 KB |
Output isn't correct |
12 |
Incorrect |
9 ms |
212 KB |
Output isn't correct |
13 |
Incorrect |
29 ms |
312 KB |
Output isn't correct |
14 |
Incorrect |
43 ms |
320 KB |
Output isn't correct |
15 |
Incorrect |
73 ms |
332 KB |
Output isn't correct |
16 |
Incorrect |
77 ms |
320 KB |
Output isn't correct |
17 |
Incorrect |
118 ms |
332 KB |
Output isn't correct |
18 |
Incorrect |
133 ms |
316 KB |
Output isn't correct |
19 |
Incorrect |
173 ms |
324 KB |
Output isn't correct |
20 |
Incorrect |
188 ms |
312 KB |
Output isn't correct |