# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
586970 | 2022-07-01T06:58:17 Z | 박상훈(#8395) | Olympiads (BOI19_olympiads) | C++17 | 2000 ms | 392 KB |
#include <bits/stdc++.h> typedef long long ll; using namespace std; priority_queue<int, vector<int>, greater<int>> pq; int n, k, C, b[505][6]; void f(int i, int c, vector<int> a){ if (c==k){ int S = 0; for (auto &x:a) S += x; pq.push(S); if ((int)pq.size()>C) pq.pop(); return; } if (i==n+1) return; f(i+1, c, a); for (int j=0;j<k;j++) a[j] = max(a[j], b[i][j]); f(i+1, c+1, a); } int main(){ scanf("%d %d %d", &n, &k, &C); for (int i=1;i<=n;i++){ for (int j=0;j<k;j++) scanf("%d", b[i]+j); } f(1, 0, vector<int>(k, 0)); printf("%d\n", pq.top()); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 340 KB | Output is correct |
2 | Correct | 16 ms | 392 KB | Output is correct |
3 | Correct | 15 ms | 392 KB | Output is correct |
4 | Correct | 10 ms | 392 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 411 ms | 296 KB | Output is correct |
2 | Correct | 447 ms | 292 KB | Output is correct |
3 | Correct | 422 ms | 296 KB | Output is correct |
4 | Correct | 420 ms | 292 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2055 ms | 340 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 340 KB | Output is correct |
2 | Correct | 16 ms | 392 KB | Output is correct |
3 | Correct | 15 ms | 392 KB | Output is correct |
4 | Correct | 10 ms | 392 KB | Output is correct |
5 | Correct | 411 ms | 296 KB | Output is correct |
6 | Correct | 447 ms | 292 KB | Output is correct |
7 | Correct | 422 ms | 296 KB | Output is correct |
8 | Correct | 420 ms | 292 KB | Output is correct |
9 | Execution timed out | 2055 ms | 340 KB | Time limit exceeded |
10 | Halted | 0 ms | 0 KB | - |