# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
963088 |
2024-04-14T13:36:49 Z |
coolboy19521 |
Poi (IOI09_poi) |
C++17 |
|
372 ms |
32080 KB |
# include <bits/stdc++.h>
namespace ddr {
# define bpc(bt) __builtin_popcountll(bt)
# define bcl(bt) __builtin_clz(bt)
# define alr(v) rbegin(v), rend(v)
# define all(v) begin(v), end(v)
# define si(v) ((ll)v.size())
# define mp make_pair
# define pb push_back
# define ins insert
# define se second
# define fi first
template <class T, size_t N> using ar = std::array <T, N>;
template <class T, class U> using pi = std::pair <T, U>;
template <class T> using pq = std::priority_queue <T>;
template <class T> using mt = std::multiset <T>;
template <class T> using ve = std::vector <T>;
template <class T> using qu = std::queue <T>;
typedef std::string str;
typedef long long ll;
typedef bool bo;
typedef char ch;
using namespace std;
const ll inf = 1e18 + 18;
}
using namespace ddr;
const ll sz = 3e5 + 15;
const ll sm = 2e3 + 6;
ll n, t, p, i, j;
ll c[sm][sm];
int main() {
cin.tie(nullptr) -> sync_with_stdio(false);
cin >> n >> t >> p;
ve <ar <ll, 3>> r;
map <ll, ll> cs;
for (i = 1; i <= n; i ++) {
ll sp = 0;
for (j = 1; j <= t; j ++) {
cin >> c[i][j];
if (c[i][j]) {
cs[j] ++;
sp ++;
}
}
r.pb({0, -sp, i});
}
for (ar <ll, 3>& k : r) {
ll po;
po = 0;
for (j = 1; j <= t; j ++) {
if (c[k[2]][j]) {
po += n - cs[j];
}
}
k[0] = -po;
}
sort(all(r));
for (i = 0; i < n; i ++) {
if (p == r[i][2]) {
cout << -r[i][0] << ' ' << 1 + i << '\n';
break;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2392 KB |
Output is correct |
7 |
Correct |
2 ms |
2396 KB |
Output is correct |
8 |
Correct |
2 ms |
2396 KB |
Output is correct |
9 |
Correct |
2 ms |
2396 KB |
Output is correct |
10 |
Correct |
4 ms |
4444 KB |
Output is correct |
11 |
Correct |
14 ms |
6748 KB |
Output is correct |
12 |
Correct |
19 ms |
8792 KB |
Output is correct |
13 |
Correct |
58 ms |
13140 KB |
Output is correct |
14 |
Correct |
95 ms |
16980 KB |
Output is correct |
15 |
Correct |
139 ms |
21072 KB |
Output is correct |
16 |
Correct |
150 ms |
21208 KB |
Output is correct |
17 |
Correct |
233 ms |
25568 KB |
Output is correct |
18 |
Correct |
248 ms |
27356 KB |
Output is correct |
19 |
Correct |
369 ms |
32080 KB |
Output is correct |
20 |
Correct |
372 ms |
32040 KB |
Output is correct |