| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 963310 | anango | Poi (IOI09_poi) | C++17 | 520 ms | 32204 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 <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
	int n,t,p;
	cin >> n >> t >> p;
	p--;
	vector<vector<int>> solves(t,vector<int>(n));
	vector<int> points(t,n);
	for (int i=0; i<n; i++) {
		for (int j=0; j<t; j++) {
			int x;
			cin >> x;
			if (x==1) solves[j][i]++;
			if (x==1) points[j]--;
		}
	}
	vector<int> score(n,0);
	vector<int> tasks(n,0);
	for (int i=0; i<n; i++) {
		for (int j=0; j<t; j++) {
			if (solves[j][i])score[i]+=points[j];
			if (solves[j][i])tasks[i]++;
		}
		//cout << score[i] <<" ";
	}
	vector<int> an;
	for (int i=0; i<n; i++) {
		an.push_back(i);
	}
	sort(an.begin(), an.end(), [=](const int x, const int y){
		if (score[x]!=score[y]) {
			return score[x]>score[y];
		}
		if (tasks[x]!=tasks[y]) {
			return tasks[x]>tasks[y];
		}
		return x<y;
	});
	int c=-1;
	for (int i=0; i<n; i++) {
		if (an[i]==p) {
			c=i+1;
		}
	}
	cout << score[p] << " " << c << endl;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
