Submission #741770

# Submission time Handle Problem Language Result Execution time Memory
741770 2023-05-14T20:56:03 Z MODDI Poi (IOI09_poi) C++14
0 / 100
587 ms 23852 KB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<long long, long long> pll;
typedef pair<int,int> pii;
typedef vector<long long> vl;
typedef vector<int> vi;
int n, t, k;
int mat[2001][2001];
struct state{
	int points;
	int cnt_solved;
	int id;
};
bool comp(state& a, state& b){
	if(a.points < b.points)	return true;
	else if(a.points > b.points)	return false;
	else{
		if(a.cnt_solved > b.cnt_solved)	return false;
		else if(a.cnt_solved < b.cnt_solved)	return true;
		else{
			if(a.id < b.id)	return true;
			return false;
		}
	}
}
int main(){
	cin>>n>>t>>k;
	k--;
	for(int i = 0; i < n; i++)
		for(int j = 0; j < t; j++)
			cin>>mat[i][j];
			
	int solved[t];
	memset(solved, 0, sizeof solved);
	for(int j = 0; j < t; j++){
		for(int i = 0; i < n; i++){
			solved[j] += mat[i][j];
		}
	}
	int points[t];
	for(int j = 0; j < t; j++)
		points[j] = n - solved[j];
		
	vector<state> arr;
	for(int i = 0; i < n; i++){
		int cnt = 0, pts = 0;
		for(int j = 0; j < t; j++){
			if(mat[i][j] == 1){
				cnt++;
				pts += points[j];
			}
		}
		state now;
		now.cnt_solved = cnt;
		now.points = pts;
		now.id = i;
		arr.pb(now);
	}
	sort(arr.begin(), arr.end(), comp);
	for(int i = 0; i < n; i++){
		if(arr[i].id == k){
			cout<<arr[i].points<<" "<<i+1<<endl;
			return 0;
		}
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Incorrect 0 ms 340 KB Output isn't correct
3 Incorrect 1 ms 340 KB Output isn't correct
4 Incorrect 1 ms 312 KB Output isn't correct
5 Incorrect 1 ms 340 KB Output isn't correct
6 Incorrect 1 ms 440 KB Output isn't correct
7 Incorrect 2 ms 596 KB Output isn't correct
8 Incorrect 2 ms 596 KB Output isn't correct
9 Incorrect 3 ms 704 KB Output isn't correct
10 Incorrect 6 ms 1236 KB Output isn't correct
11 Incorrect 20 ms 2112 KB Output isn't correct
12 Incorrect 31 ms 3476 KB Output isn't correct
13 Incorrect 86 ms 6500 KB Output isn't correct
14 Incorrect 122 ms 9268 KB Output isn't correct
15 Incorrect 225 ms 12636 KB Output isn't correct
16 Incorrect 308 ms 13716 KB Output isn't correct
17 Incorrect 445 ms 16724 KB Output isn't correct
18 Incorrect 411 ms 18876 KB Output isn't correct
19 Incorrect 541 ms 23016 KB Output isn't correct
20 Incorrect 587 ms 23852 KB Output isn't correct