Submission #657244

#TimeUsernameProblemLanguageResultExecution timeMemory
657244happypotatoPoi (IOI09_poi)C++17
70 / 100
593 ms23744 KiB
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n, t, p;
	cin >> n >> t >> p;
	int a[n + 1][t];
	int score[n + 1], solves[n + 1];
	for (int i = 1; i <= n; i++) {
		score[i] = 0;
		solves[i] = 0;
		for (int j = 0; j < t; j++) {
			cin >> a[i][j];
			solves[i] += a[i][j];
		}
	}
	for (int i = 0; i < t; i++) {
		int mark = 0;
		for (int j = 1; j <= n; j++) {
			mark += (a[j][i] == 0);
		}
		for (int j = 1; j <= n; j++) {
			if (a[j][i]) score[j] += mark;
		}
	}
	int rank = 1;
	for (int i = 1; i <= n; i++) {
		if (i == p) continue;
		if (score[i] > score[p] || (score[i] == score[p] && i < p)) rank++;
	}
	cout << score[p] << ' ' << rank << endl;
}
#Verdict Execution timeMemoryGrader output
Fetching results...