# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
175552 | 2020-01-07T08:12:21 Z | illiboy1212 | None (KOI17_room) | C++14 | 2 ms | 256 KB |
#include <cstdio> #include <utility> #include <algorithm> using namespace std; int n, m; pair <int, int> arr[110]; pair <int ,int> brr[110]; pair<int,int> dp[1000000]; int main() { int siz = 0; int k; int max = 0; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { scanf("%d %d %d %d", &arr[i].first, &arr[i].second, &brr[i].first, &brr[i].second); } for (int i = 0; i < n; i++) { k=0; for (int j = 0; j <= siz ; j++) { if (dp[j].first + arr[i].first > m) { } else { k++; dp[siz+k].first = dp[j].first+arr[i].first; dp[siz+k].second = dp[j].second + arr[i].second; } if (dp[j].first + brr[i].first > m) { } else { k++; dp[siz+k].first = dp[j].first+brr[i].first; dp[siz+k].second = dp[j].second + brr[i].second; } } siz+=k; } for (int i = 0; i <= siz; i++) { if (dp[i].second > max) { max = dp[i].second; } } printf("%d", max); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 252 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 252 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |