# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
646263 | 2022-09-29T10:44:02 Z | berr | Olympiads (BOI19_olympiads) | C++17 | 282 ms | 262144 KB |
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); int n, k, c; cin>>n>>k>>c; vector<vector<int>> a[k+1]; vector<vector<int>> b(n, vector<int>(k)); for(int i=0; i<n; i++) { for(int l=0; l<k; l++) { cin>>b[i][l]; } } for(int i=0; i<n; i++) { for(int l=k-1; l>=1; l--) { for(auto p: a[l]) { vector<int> s=p; for(int j=0; j<k; j++) s[j]=max(s[j], b[i][j]); a[l+1].push_back(s); } } a[1].push_back(b[i]); } vector<int> ans; for(int i=0; i<a[k].size(); i++) { int s=0; for(auto l: a[k][i]) { s+=l; } ans.push_back(s); } sort(ans.begin(), ans.end(), greater<int>()); cout<<ans[c-1]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 21 ms | 9220 KB | Output is correct |
2 | Correct | 20 ms | 9220 KB | Output is correct |
3 | Correct | 18 ms | 9220 KB | Output is correct |
4 | Correct | 16 ms | 9204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 278 ms | 262144 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 282 ms | 262144 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 21 ms | 9220 KB | Output is correct |
2 | Correct | 20 ms | 9220 KB | Output is correct |
3 | Correct | 18 ms | 9220 KB | Output is correct |
4 | Correct | 16 ms | 9204 KB | Output is correct |
5 | Runtime error | 278 ms | 262144 KB | Execution killed with signal 9 |
6 | Halted | 0 ms | 0 KB | - |