Submission #631634

#TimeUsernameProblemLanguageResultExecution timeMemory
631634PolishFighterPoi (IOI09_poi)C++17
70 / 100
284 ms4216 KiB
#include<bits/stdc++.h>

using namespace std;

constexpr int MAXN = 2e3 + 10;

int points[MAXN];
bool contestants[MAXN][MAXN];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int n, t, p;
	cin >> n >> t >> p;
	p--;
	for(int i = 0; i < n; i++)
	{
		for(int j = 0; j < t; j++)
		{
			cin >> contestants[i][j];
			if(contestants[i][j] == 0)
			{
				points[j]++;
			}
		}
	}

	int philips_p = 0;
	int philips_t = 0;
	for(int i= 0; i < t; i++)
	{
		if(contestants[p][i])
		{
			philips_t++;
			philips_p += points[i];
		}
	}
	
	int philips_r = 1;
	int points2;
	int t2;
	for(int i = 0; i < n ; i++)
	{
		t2 = 0;
		points2 = 0;


		for(int j = 0; j < t; j++)
		{
			if(contestants[i][j])
			{
              	t2++;
				points2 += points[j];
			}
		}


		if(points2 > philips_p || (points2 == philips_p && (i < p || t2 > philips_t)))
		{
			philips_r++;
		}
	}

	cout << philips_p << " " << philips_r << "\n";

	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...