# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
518593 | blue | Poi (IOI09_poi) | C++17 | 557 ms | 23824 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 <iostream>
#include <vector>
using namespace std;
int main()
{
int N, T, P;
cin >> N >> T >> P;
vector<int> S(T+1, 0);
vector<int> TC(N+1, 0);
int** solved = new int*[N+1];
for(int i = 1; i <= N; i++) solved[i] = new int[T+1];
for(int i = 1; i <= N; i++) for(int j = 1; j <= T; j++)
{
cin >> solved[i][j];
S[j] += solved[i][j];
TC[i] += solved[i][j];
}
vector<int> score(N+1, 0);
for(int i = 1; i <= N; i++) for(int j = 1; j <= T; j++) score[i] += solved[i][j] * (N - S[j]);
int r = 1;
for(int i = 1; i < P; i++) if(score[i] > score[P] || (score[i] == score[P] && TC[i] >= TC[P])) r++;
for(int i = P+1; i <= N; i++) if((score[i] > score[P]) || (score[i] == score[P] && TC[i] > TC[P])) r++;
cout << score[P] << ' ' << r << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |