# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
262216 |
2020-08-12T13:33:38 Z |
BlancaHM |
Poi (IOI09_poi) |
C++14 |
|
363 ms |
22944 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[P-1] << " " << i+1 << "\n";
break;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
0 ms |
384 KB |
Output is correct |
3 |
Correct |
0 ms |
384 KB |
Output is correct |
4 |
Correct |
0 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
384 KB |
Output is correct |
7 |
Correct |
1 ms |
384 KB |
Output is correct |
8 |
Correct |
1 ms |
384 KB |
Output is correct |
9 |
Correct |
2 ms |
384 KB |
Output is correct |
10 |
Correct |
3 ms |
512 KB |
Output is correct |
11 |
Correct |
10 ms |
1024 KB |
Output is correct |
12 |
Correct |
16 ms |
1536 KB |
Output is correct |
13 |
Correct |
47 ms |
3832 KB |
Output is correct |
14 |
Correct |
67 ms |
5368 KB |
Output is correct |
15 |
Correct |
124 ms |
9188 KB |
Output is correct |
16 |
Correct |
132 ms |
10104 KB |
Output is correct |
17 |
Correct |
222 ms |
14456 KB |
Output is correct |
18 |
Correct |
218 ms |
16376 KB |
Output is correct |
19 |
Correct |
292 ms |
21368 KB |
Output is correct |
20 |
Correct |
363 ms |
22944 KB |
Output is correct |