Submission #262162

# Submission time Handle Problem Language Result Execution time Memory
262162 2020-08-12T12:33:29 Z BlancaHM Poi (IOI09_poi) C++14
0 / 100
348 ms 23980 KB
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstring>
#include <cmath>
#include <climits>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<vvvi> vvvvi;
typedef vector<pii> vpii;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vvvl> vvvvl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define len(v) ((int)v.size())
#define all(v) v.begin(), v.end()

vi points, solved, solvedP;

bool comp(int i, int j) {
	if (points[i] > points[j]) return true;
	else if (points[i] < points[j]) return false;
	else if (solvedP[i] > solvedP[j]) return true;
	else if (solvedP[i] < solvedP[j]) return false;
	else return i < j;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int N, T, P;
	cin >> N >> T >> P;
	int grid[N][T], play[N];
	points.assign(N, 0);
	solvedP.assign(N, 0);
	solved.assign(T, 0);
	for (int i = 0; i < N; i++) {
		play[i] = i;
		for (int j = 0; j < T; j++) {
			cin >> grid[i][j];
		}
	}
	for (int i = 0; i < T; i++) {
		for (int j = 0; j < N; j++) solved[i] += grid[j][i];
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < T; j++) {
			if (grid[i][j]) {
				points[i] += N-solved[j];
				solvedP[i]++;
			}
		}
	}
	sort(play, play+N, comp);
	for (int i = 0; i < N; i++) {
		if (play[i] == P-1) {
			cout << points[i] << " " << i+1 << "\n";
			break;
		}
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 512 KB Output isn't correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Incorrect 1 ms 384 KB Output isn't correct
4 Incorrect 1 ms 384 KB Output isn't correct
5 Incorrect 1 ms 384 KB Output isn't correct
6 Incorrect 1 ms 384 KB Output isn't correct
7 Incorrect 1 ms 384 KB Output isn't correct
8 Incorrect 1 ms 384 KB Output isn't correct
9 Incorrect 2 ms 384 KB Output isn't correct
10 Incorrect 4 ms 512 KB Output isn't correct
11 Incorrect 10 ms 1024 KB Output isn't correct
12 Incorrect 18 ms 1528 KB Output isn't correct
13 Incorrect 47 ms 3840 KB Output isn't correct
14 Incorrect 77 ms 5368 KB Output isn't correct
15 Incorrect 131 ms 9208 KB Output isn't correct
16 Incorrect 129 ms 9848 KB Output isn't correct
17 Incorrect 189 ms 14456 KB Output isn't correct
18 Incorrect 246 ms 16376 KB Output isn't correct
19 Incorrect 336 ms 21464 KB Output isn't correct
20 Incorrect 348 ms 23980 KB Output isn't correct