Submission #874913

#TimeUsernameProblemLanguageResultExecution timeMemory
874913TAhmed33Olympiads (BOI19_olympiads)C++98
13 / 100
7 ms1492 KiB
#include <bits/stdc++.h> using namespace std; #define int long long vector <int> sums; signed main () { int n, k, c; cin >> n >> k >> c; int arr[n][k]; for (int i = 0; i < n; i++) for (int j = 0; j < k; j++) cin >> arr[i][j]; if (k == 1) { for (int i = 0; i < n; i++) { int sum = 0; for (int j = 0; j < k; j++) { sum += arr[i][j]; } sums.push_back(sum); } } else { for (int i = 0; i < n; i++) { for (int j = 0; j < i; j++) { int sum = 0; for (int l = 0; l < k; l++) { sum += max(arr[i][l], arr[j][l]); } sums.push_back(sum); } } } sort(sums.begin(), sums.end()); reverse(sums.begin(), sums.end()); cout << sums[c - 1] << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...