#include <bits/stdc++.h>
using namespace std;
int main () {
int n, m, k; cin >> n >> m >> k;
int a[n][m];
for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) cin >> a[i][j];
vector<int> b;
for(int i = 0; i < n; i++) for(int j = i + 1; j < n; j++) b.push_back(max(a[i][0], a[j][0]) + max(a[i][1], a[j][1]));
sort(b.rbegin(), b.rend());
cout << b[k - 1];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
980 KB |
Output is correct |
2 |
Correct |
6 ms |
984 KB |
Output is correct |
3 |
Correct |
5 ms |
984 KB |
Output is correct |
4 |
Correct |
2 ms |
984 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
980 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
980 KB |
Output is correct |
2 |
Correct |
6 ms |
984 KB |
Output is correct |
3 |
Correct |
5 ms |
984 KB |
Output is correct |
4 |
Correct |
2 ms |
984 KB |
Output is correct |
5 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |