# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
347918 | Alma | Poi (IOI09_poi) | C++14 | 713 ms | 24172 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 <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void POI (vector<vector<int>>& results, int& N, int& T, int& P) {
vector<int> value;
value.assign(T, 0);
for (int i = 0; i < N; i++) {
for (int j = 0; j < T; j++) {
if (results[i][j] == 0) {
value[j]++;
}
}
}
vector<int> scores (N);
for (int i = 0; i < N; i++) {
int points = 0;
for (int j = 0; j < T; j++) {
if (results[i][j] == 1) {
points += value[j];
}
scores[i] = points;
}
}
int P_score = scores[P-1];
int P_rank = P;
cout << P_score << ' ' << P_rank << endl;
}
int main () {
int N, T, P; cin >> N >> T >> P;
vector<vector<int>> results;
for (int i = 0; i < N; i++) {
vector<int> res (T);
for (int j = 0; j < T; j++) {
int a; cin >> a;
res[j] = a;
}
results.push_back(res);
}
POI (results, N, T, P);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |