# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
745900 | 2023-05-21T09:27:50 Z | vjudge1 | Kitchen (BOI19_kitchen) | C++17 | 70 ms | 90436 KB |
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 300; const int M = 15; int main(){ int n, m, k; cin >> n >> m >> k; vector <int> whours(n); for(int i = 0; i < n; i++){ cin >> whours[i]; } vector <int> reality(m); for(int i = 0; i < m; i++){ cin >> reality[i]; } /*for(int i : whours) cout << i <<endl; for(int i : reality) cout << i;*/ int cntw = 0; int cntr = 0; int dif = n*k; int maxi = N*(M+1); int darab, darab2 = 0; for(int i = 0; i < whours.size(); i++){ cntw += whours[i]; } if(m < k || dif > maxi)cout << "Impossible\n"; int dp[maxi+1][maxi+1]; for(int c = 0; c < reality.size(); c++){ darab = min(darab, c); darab2 = c; } for(int i = maxi; i >= darab; i--){ for(int j = maxi; j >= darab2; j--){ dp[darab][darab2] |= dp[i - darab][j - darab2]; } } for(int i = cntw; i < maxi; i++){ for(int j = dif; j < maxi; j++){ if(dp[i][j]){ cout << i - maxi << '\n'; } } //cout << "Impossible\n"; } /*else if(m == 2 && k == 1){ for(int i = 0; i < reality.size(); i++){ cntr = min(cntr, reality[i]); } cout << cntr - cntw; } else{ for(int i = 0; i < reality.size(); i++){ cntr += reality[i]; } cout << cntr - cntw; }*/ }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 70 ms | 90384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 70 ms | 90384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 54 ms | 90436 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 63 ms | 90404 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 70 ms | 90384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |