# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
561882 |
2022-05-13T17:29:07 Z |
Halym2007 |
Poi (IOI09_poi) |
C++11 |
|
332 ms |
31872 KB |
#include <bits/stdc++.h>
#define ff first
#define ss second
#define cont continue;
#define sz size()
#define pb push_back
using namespace std;
typedef long long ll;
const int N = 5005;
void solve();
int n, t, kl, c, a[N][N];
pair <int, pair <int, int>> p[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
cin >> n >> t >> kl;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= t; ++j) {
cin >> a[i][j];
}
}
for (int i = 1; i <= t; ++i) {
c = 0;
for (int j = 1; j <= n; ++j) {
if (!a[j][i]) c++;
}
for (int j = 1; j <= n; ++j) if (a[j][i]) p[j].ff += c;
}
for (int i = 1; i <= n; ++i) {
c = 0;
for (int j = 1; j <= t; ++j) {
if (a[i][j] == 1) c++;
}
p[i].ss.ff = c;
p[i].ss.ss = i;
}
for (int i = 1; i <= n; ++i) {
p[i].ff *= -1;
p[i].ss.ff *= -1;
}
sort (p + 1,p + n + 1);
for (int i = 1; i <= n; ++i) {
if (p[i].ss.ss == kl) {
return cout << abs (p[i].ff) << " " << i, 0;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
456 KB |
Output is correct |
6 |
Correct |
1 ms |
468 KB |
Output is correct |
7 |
Correct |
1 ms |
596 KB |
Output is correct |
8 |
Correct |
1 ms |
600 KB |
Output is correct |
9 |
Correct |
2 ms |
724 KB |
Output is correct |
10 |
Correct |
3 ms |
1236 KB |
Output is correct |
11 |
Correct |
9 ms |
2140 KB |
Output is correct |
12 |
Correct |
14 ms |
3452 KB |
Output is correct |
13 |
Correct |
41 ms |
6552 KB |
Output is correct |
14 |
Correct |
69 ms |
9292 KB |
Output is correct |
15 |
Correct |
108 ms |
13920 KB |
Output is correct |
16 |
Correct |
128 ms |
14996 KB |
Output is correct |
17 |
Correct |
171 ms |
20420 KB |
Output is correct |
18 |
Correct |
233 ms |
23048 KB |
Output is correct |
19 |
Correct |
267 ms |
29428 KB |
Output is correct |
20 |
Correct |
332 ms |
31872 KB |
Output is correct |