# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
670732 |
2022-12-10T05:46:14 Z |
skittles1412 |
Poi (IOI09_poi) |
C++17 |
|
261 ms |
12012 KB |
#include "bits/extc++.h"
using namespace std;
template <typename T>
void dbgh(const T& t) {
cerr << t << endl;
}
template <typename T, typename... U>
void dbgh(const T& t, const U&... u) {
cerr << t << " | ";
dbgh(u...);
}
#ifdef DEBUG
#define dbg(...) \
cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]" \
<< ": "; \
dbgh(__VA_ARGS__)
#else
#define cerr \
if (false) \
cerr
#define dbg(...)
#endif
#define endl "\n"
#define long int64_t
#define sz(x) int(std::size(x))
void solve() {
int n, m, kv;
cin >> n >> m >> kv;
kv--;
bool arr[n][m];
for (auto& a : arr) {
for (auto& b : a) {
cin >> b;
}
}
int score[m] {};
for (auto& a : arr) {
for (int i = 0; i < m; i++) {
score[i] += !a[i];
}
}
array<int, 3> sarr[n];
for (int i = 0; i < n; i++) {
int cs = 0, cnt = 0;
for (int j = 0; j < m; j++) {
if (arr[i][j]) {
cnt++;
cs += score[j];
}
}
sarr[i] = {-cs, -cnt, i};
}
sort(sarr, sarr + n);
for (int i = 0; i < n; i++) {
if (sarr[i][2] == kv) {
cout << -sarr[i][0] << " " << i + 1 << endl;
}
}
}
int main() {
cin.tie(nullptr);
cin.exceptions(ios::failbit);
ios_base::sync_with_stdio(false);
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
316 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
2 ms |
364 KB |
Output is correct |
10 |
Correct |
2 ms |
468 KB |
Output is correct |
11 |
Correct |
9 ms |
596 KB |
Output is correct |
12 |
Correct |
14 ms |
852 KB |
Output is correct |
13 |
Correct |
39 ms |
1992 KB |
Output is correct |
14 |
Correct |
56 ms |
2780 KB |
Output is correct |
15 |
Correct |
100 ms |
4836 KB |
Output is correct |
16 |
Correct |
106 ms |
5084 KB |
Output is correct |
17 |
Correct |
157 ms |
7240 KB |
Output is correct |
18 |
Correct |
174 ms |
8196 KB |
Output is correct |
19 |
Correct |
238 ms |
11092 KB |
Output is correct |
20 |
Correct |
261 ms |
12012 KB |
Output is correct |